Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

Project Seven dot com
Search
 

pvii productivity tools 01

PVII Link JavaScript File Command

Creating a link to an external JavaScript file couldn't be easier! The Link JavaScript File command window lists all of the JavaScript files in your current Dreamweaver site. Simply select the one you want to link. The Link JavaScript File command allows you to quickly and effortlessly create a script tag link to any external JavaScript file in your site. Using a linked JavaScript file, instead of scripts embedded on your page, drastically reduces page weight (and download time) because the file only needs to be downloaded once by the browser. For every successive page that is viewed, the browser simply retrieves the file from its cache.

Running PVII Link JavaScript File Command

  1. Choose Commands --> PVII Productivity Tools --> Link JavaScript File to open the interface.
  2. Select the JavaScript file you wish to link.
  3. Set the options you desire.
  4. Click OK to link the file.

The Interface

The Link JavaScript File interface allows you to quickly and easily link any existing JavaScript file located in your defined Dreamweaver site.

The Link JavaScript File Interface

Files

The Files box presents a listing of all the JavaScript files (files with the .js file extension) that exist within your defined Dreamweaver site. Each file is listed using the relative path from your current document, including folder names, to make identification of the various files easy.

Note: The first line will always read "Select a JavaScript File to Link.." a reminder to select one of the files in the listing. On extremely large sites (sites with hundreds of folders or JavaScript files) the listing may take a bit of time to display. In this case, you'll see a message stating: Stand By... scanning site for JavaScript files in your site... and the list box may even disappear momentarily. This is normal... Dreamweaver is being asked to do a lot of work. Be patient, the box will populate soon... ready for use.

Select (click) the file that you wish to link.

Options

Link options allow you to select the syntax for the link you are creating. You can choose to include the language attribute, the type attribute, both the language and type attributes, or no attributes. These attributes describe the scripting language being used in the file, which in this case is JavaScript. Prior to HTML 4, the language attribute was the accepted way to tell the browser what scripting language was being used. HTML 4 introduced the type attribute and deprecated the language attribute. The type attribute is now the standard means of setting the scripting language and is the only attribute that should be used with a strict HTML or XHTML DOCTYPE. To provide full compatibility and flexibility, we have included the option to allow you to include the attribute of your choice.

The link tag will be created as follows:

No options checked:

This will produce a script tag with minimal syntax:

<script src="menu3.js"></script>
Use language option is checked:

This will produce a script tag with just the language attribute defined:

<script language="JavaScript" src="menu3.js"></script> 
Use type option is checked:

This will produce a script tag with the type attribute defined:

<script type="text/javascript" src="menu3.js"></script> 
Both options are checked:

This will produce a script tag with both the language and type attributes defined:

<script language="JavaScript" type="text/javascript" src="menu3.js"></script>

Use language-"JavaScript"

Check this box if you wish to declare the language attribute in your script tag. This attribute is deprecated in HTML 4 but is still widely used. The language attribute is also understood by many older browsers and can be safely used to provide backward compatibility to version 3 and lower browsers. The language attribute will not validate with an HTML 4.01 or XHTML DOCTYPE.

Use type="text/javascript"

Check this box if you wish to declare the type attribute in your script tag. The type attribute replaces the language attribute in HTML 4 and should normally be used to provide full future compatibility. The type attribute will validate with a strict or transitional HTML4.01 or XHTML DOCTYPE.

The Interface Control Buttons

OK

Once you have selected the desired options and the external JavaScript file, click OK to create a link to the external JavaScript file you selected.

Cancel

Click the Cancel button to close the interface without making any changes to your page.

Help

Click the Help button to open the associated Help File in your browser. The page can remain open for easy reference while you continue working with the extension interface.