#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    46
    Rep Power
    12

    Load javascript last?


    In my html I am currently calling an external javascript from another site. It runs a small text ad at the top of the page. But the external site does not always load due to server issues, etc. When the javascript is down, it delays the loading time for the entire page a few seconds. Is there a way that I can load this javascript after all other elements have been loaded so that the load time for the page will not be jeopardized? Thanks.
  2. #2
  3. No Profile Picture
    Senior Citizen
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2001
    Location
    leftcoast
    Posts
    2,019
    Rep Power
    16
    No way to answer that without seeing the script itself. It likely outputs via document.write(), in which case its placement in the document is critical - it'll stream its HTML wherever the tagpair is embedded. JS files download in series: parsing stops until they arrive, and are processed. Probably a solution somewhere.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Posts
    46
    Rep Power
    12
    Here's the script. It is run throught a script src call in the middle of the html code:

    <!--
    <TABLE WIDTH="285" BORDER="0" CELLSPACING="0" CELLPADDING="1">
    <TR>
    <TD WIDTH="275" BGCOLOR="#003c77">
    <TABLE WIDTH="275" BORDER="0" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD WIDTH="100%" BGCOLOR="#d5eaff">
    <P><script src="http://www.textads.biz/getNextAd.jsp?siteref=30a72f1f639dbb792673a10bc96a8a40&adNum=1"></script></TD>
    </TR>
    </TABLE><TABLE WIDTH="275" BORDER="0" CELLSPACING="0" CELLPADDING="4">
    <TR>
    <TD WIDTH="100%" BGCOLOR="#d5eaff">
    <P ALIGN=RIGHT><FONT SIZE="-2" FACE="Arial">&gt;&gt; <A HREF="http://www.noticetothepublic.com/adinfo.html" CLASS="nav">Buy
    Your Own Text Ad</A></FONT></TD>
    </TR>
    </TABLE></TD>
    <TD WIDTH="10"></TD>
    </TR>
    </TABLE>
    //-->

IMN logo majestic logo threadwatch logo seochat tools logo