Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


External JavaScripts

external javascripts

  • Please log in to reply
 

#1 DesGuru

DesGuru

    Senior Member

  • Designer
  • 220 posts

Posted 06 November 2012 - 04:15 PM

JavaScripts can be placed in external files. The external files usually contain code that will be used by a number of different web pages.
An external JavaScript file would.js as its file extension. To use an external javascript, you have to point to the ‘ .js’ file in the ‘src’ attribute of the tag <script> :
Example of an external JavaScript
<!DOCTYPE html>
<html>
<body>
<script src="NewScript.js"></script>
</body>
</html>

You can place the javascript anywhere in the <head> or <body>. The script will just behave as it was exactly located where the <script> tag was put in the document.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users