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


Advantages of External Scripts

advantages external javascript

  • Please log in to reply
 

#1 SmartWeb

SmartWeb

    Senior Member

  • Designer
  • 271 posts

Posted 18 December 2012 - 05:23 PM

When writing a script you will regularly use in a multiple Web pages site, instead of having to add the same script over and over again, you can simply save it as an external text file and then add in a pointer to every Web page you have. You should write this script without using the beginning and ending <script> and </script> tags and also without the HTML comment tags. Then you should change your file’s extension to .js. To point to the external script location, you need to include the "src" attribute. For example, saving an external script for a date display function as DateDisplay.js. Decide where you want the script to run and then insert the pointer into the HTML code where you wish the script to start running : <script type="yourtext/javascript" src="DateDisplay.js"></script>. This will call your external script and run it.





Also tagged with one or more of these keywords: advantages, external javascript

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users