Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Howto Add a timeout to a javascript ad tag

Reply
Thread Tools

Howto Add a timeout to a javascript ad tag

 
 
Neil Sandow
Guest
Posts: n/a
 
      09-20-2003
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="JavaScript1.1"
SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_jx.cgi/www.rxlist.com/A%%ID%%@Top?topic=%%CAT%%"></SCRIPT>
<SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript"><!--_version=10;
//--> </SCRIPT>
<SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript1.1">
<!--_version=11; // --> </SCRIPT>
<SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript">
<!--if (navigator.appVersion.indexOf('MSIE 3')>
-1){document.write('<IFRAME WIDTH=468 HEIGHT=60 MARGINWIDTH=0
MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no
BORDERCOLOR="#000000"
SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_sx.cgi/www.rxlist.com/A%%ID%%@Top?topic=%%CAT%%"></iframe>');}
else if (_version < 11) {document.write ('<A
HREF="http://ads.mdchoice.com/RealMedia/ads/click_nx.cgi/www.rxlist.com/A%%ID%%@Top?topic=%%CAT%%">');document.write
('<img alt="
SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_nx.cgi/www.rxlist.com/A%%ID%%@Top?topic=%%CAT%%"
border=0 WIDTH=468 HEIGHT=60></a>');}// --></SCRIPT>


Thanks! -Neil

 
Reply With Quote
 
 
 
 
Ivo
Guest
Posts: n/a
 
      09-21-2003
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" <(E-Mail Removed)> wrote in message
newsINab.353$(E-Mail Removed) .com...
> 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="JavaScript1.1"
>

SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_jx.cgi/www.rxlist.com/A%
%ID%%@Top?topic=%%CAT%%"></SCRIPT>
> <SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript"><!--_version=10;
> //--> </SCRIPT>
> <SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript1.1">
> <!--_version=11; // --> </SCRIPT>
> <SCRIPT TYPE='text/javascript' LANGUAGE="JavaScript">
> <!--if (navigator.appVersion.indexOf('MSIE 3')>
> -1){document.write('<IFRAME WIDTH=468 HEIGHT=60 MARGINWIDTH=0
> MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no
> BORDERCOLOR="#000000"
>

SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_sx.cgi/www.rxlist.com/A%
%ID%%@Top?topic=%%CAT%%"></iframe>');}
> else if (_version < 11) {document.write ('<A
>

HREF="http://ads.mdchoice.com/RealMedia/ads/click_nx.cgi/www.rxlist.com/A%%I
D%%@Top?topic=%%CAT%%">');document.write
> ('<img alt="
>

SRC="http://ads.mdchoice.com/RealMedia/ads/adstream_nx.cgi/www.rxlist.com/A%
%ID%%@Top?topic=%%CAT%%"
> border=0 WIDTH=468 HEIGHT=60></a>');}// --></SCRIPT>
>
>
> Thanks! -Neil
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ASP.NET] How to add javascript between two specific tag? tranky ASP .Net 2 08-29-2006 02:52 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
How to add a timeout to a javascript ad tag Neil Sandow Javascript 1 09-20-2003 08:54 PM
Add a timeout to javascript ad tags Neil Sandow Javascript 0 09-19-2003 11:47 PM



Advertisments