Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Client Scripting
Expertise: Beginner
Oct 22, 1999



Application Security Testing: An Integral Part of DevOps

Reference an External JavaScript File


How do you reference an external JavaScript file from an HTML page?


You can reference an external JavaScript file from your HTML page similar to the way you'd reference an image. The syntax is:

This will make your browser download the mycode.js file and interpret the JavaScript code within it—just as if it were included in your page. As with an image, you can use any URL that points to a JavaScript file, including ones on servers other than your own. Note: It is very important that you include a closing tag within your HTML file. The external reference will not work without it.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date