Home Search Member List Faq Register Login  
JavaScript Tips
Cache your scripts

Thread Starter: Karamasoft   Started: 09-18-2007 12:37 PM   Replies: 0
 Karamasoft Support Forums » General Discussions » JavaScript Tips » Cache your scripts
 Printable Version    « Previous Thread   Next Thread »
  18 Sep 2007, 12:37 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Cache your scripts

Using a JavaScript include file has several advantages compared to directly embedding JavaScript code inside a script block. The main advantage is that it provides code reuse by keeping the code in a central place. Another advantage is that your page size will be reduced significantly causing the page to be easier to maintain. Probably the most important advantage is caching by the browser. Subsequent requests to your page will retrieve the JavaScript library from the browser cache in order to load a lot faster.

You can place your JavaScript code in a “.js” file, and include it in your web pages using the following syntax:

<script src="KaramasoftUtility.js" type="text/javascript"></script>


  
 Page 1 of 1 (1 items)
Karamasoft Support Forums » General Discussions » JavaScript Tips » Cache your scripts

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.