SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Preloading .js files?

    I have a wordpress site which uses Cufon & curvy corners javascripts.

    On the initial load the site loads before the javascripts so there is a delay where it loads regular corners and text until it switches.

    Is it possible to preload the js files before the rest of the site loads?

    Thanks in advance

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Putting the scripts references in the <head> may reduce the amount of time that your page remains rendered without the additional effects. It depends on how the scripts are written, and which browser the visitor is using.

    Generally, I wouldn't do it though. This is just a minor cosmetic effect, and you stand the potential to significantly delay the display of the webpage for some users. Most people imo would rather see the page faster, even if it less pretty for a moment.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,682
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Improvements in loading speed can be made by combining multiple images into one tileset image, then use CSS to show only part of that tileset.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Enthusiast
    Join Date
    Oct 2008
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. The javascripts are referenced in the head already.

    It also doesnt use many images pmw57 so I dont think that would make much difference.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •