Howto Add a timeout to a javascript ad tag

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neil Sandow

    Howto Add a timeout to a javascript ad tag

    My site with servers located on the West Coast runs ads served by an
    adserver on the East Coast. A not infrequent problem occurs when a
    user on the West Coast tries to load a page but for whatever reason
    can't reach the adserver. It causes a portion or the entire page to
    hang until the request times out. This can take up to 30 seconds or
    more. Is there a way to set up a time frame which will drop the
    request or route it to a local default file under these circumstances?

    Here's an example of a current tag for a 468 x 60 banner:

    <!-- CODE FOR TOP BANNER -->
    <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript1.1"
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_jx.cgi/www.rxlist.com/A%%ID%%@Top?top ic=%%CAT%%"></SCRIPT>
    <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript"><!--_version=10;
    //--> </SCRIPT>
    <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript1.1">
    <!--_version=11; // --> </SCRIPT>
    <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript">
    <!--if (navigator.appV ersion.indexOf( 'MSIE 3')>
    -1){document.wri te('<IFRAME WIDTH=468 HEIGHT=60 MARGINWIDTH=0
    MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no
    BORDERCOLOR="#0 00000"
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_sx.cgi/www.rxlist.com/A%%ID%%@Top?top ic=%%CAT%%"></iframe>');}
    else if (_version < 11) {document.write ('<A
    HREF="http://ads.mdchoice.co m/RealMedia/ads/click_nx.cgi/www.rxlist.com/A%%ID%%@Top?top ic=%%CAT%%">'); document.write
    ('<img alt="
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_nx.cgi/www.rxlist.com/A%%ID%%@Top?top ic=%%CAT%%"
    border=0 WIDTH=468 HEIGHT=60></a>');}// --></SCRIPT>


    Thanks! -Neil

  • Ivo

    #2
    Re: Howto Add a timeout to a javascript ad tag

    Looks like your page doesn't need any of the code you posted. If so, why not
    remove all of this, and tell the page in one line of script to load the ad
    scripts after it has finished loading.
    Or remove the urls from the code, and set them dynamically onload.

    "Neil Sandow" <rx@rxlist.co m> wrote in message
    news:PINab.353$ 9x2.53025965@ne wssvr14.news.pr odigy.com...[color=blue]
    > user on the West Coast tries to load a page but for whatever reason
    > can't reach the adserver. It causes a portion or the entire page to
    > hang until the request times out. This can take up to 30 seconds or
    > more. Is there a way to set up a time frame which will drop the
    > request or route it to a local default file under these circumstances?
    >
    > Here's an example of a current tag for a 468 x 60 banner:
    >
    > <!-- CODE FOR TOP BANNER -->
    > <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript1.1"
    >[/color]
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_jx.cgi/www.rxlist.com/A%
    %ID%%@Top?topic =%%CAT%%"></SCRIPT>[color=blue]
    > <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript"><!--_version=10;
    > //--> </SCRIPT>
    > <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript1.1">
    > <!--_version=11; // --> </SCRIPT>
    > <SCRIPT TYPE='text/javascript' LANGUAGE="JavaS cript">
    > <!--if (navigator.appV ersion.indexOf( 'MSIE 3')>
    > -1){document.wri te('<IFRAME WIDTH=468 HEIGHT=60 MARGINWIDTH=0
    > MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no
    > BORDERCOLOR="#0 00000"
    >[/color]
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_sx.cgi/www.rxlist.com/A%
    %ID%%@Top?topic =%%CAT%%"></iframe>');}[color=blue]
    > else if (_version < 11) {document.write ('<A
    >[/color]
    HREF="http://ads.mdchoice.co m/RealMedia/ads/click_nx.cgi/www.rxlist.com/A%%I
    D%%@Top?topic=% %CAT%%">');docu ment.write[color=blue]
    > ('<img alt="
    >[/color]
    SRC="http://ads.mdchoice.co m/RealMedia/ads/adstream_nx.cgi/www.rxlist.com/A%
    %ID%%@Top?topic =%%CAT%%"[color=blue]
    > border=0 WIDTH=468 HEIGHT=60></a>');}// --></SCRIPT>
    >
    >
    > Thanks! -Neil
    >[/color]


    Comment

    Working...