SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist hessodreamy's Avatar
    Join Date
    Apr 2005
    Location
    uk
    Posts
    528
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    external scripts slowing page load

    There's references on some of my page to scripts on other sites (tracking scripts, postcode finder etc).
    Now, if these scripts have trouble loading, or are slow, would that slow down the rest of my page load? it seems to.
    Looking at the details in firebug, it seems to be only scripts specified in the header that hold up further loading. But I'm not sure about that.
    It seems to happen especially on secure pages, and i was thinking that maybe the servers from where the scripts are served are a little slower on secure pages. I dunno.
    Should they slow down my page? How can I get an external script to load only when the rest of the page is done?

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use ajax, or document.createElement a script from an onload handler

  3. #3
    SitePoint Evangelist hessodreamy's Avatar
    Join Date
    Apr 2005
    Location
    uk
    Posts
    528
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    so is it normal and expected for external scripts in the body of a document to slow down the page load?

  4. #4
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can always save the external Javascript files to your own server and link to them. See if there's a 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
  •