/    Sign up×
Community /Pin to ProfileBookmark

Ad rotator driving mozilla wiggy

I have a simple ad rotator that’s driving mozilla and netscape a little crazy. You know that symbol in the upper right corner of the browser that animates while a page is downloading and is supposed to stop once the page is loaded? Well, after my rotate() function is called the animation starts and stops randomly as I move the mouse around the page over various other links.
This only happens in Netscape and Mozilla firefox.
Did I do something nonstandard or is this an idiosyncrasy/bug/feature in the mozilla engine?

Here’s the javascript function:
function rotate()
{
numAds=8
adNum = Math.ceil(Math.random()*numAds);
frames[‘ads’].location.href=”/ads/fullbanner/ad”+adNum+”/ad.html”;
}

where frames[‘ads’] is this iframe.
<iframe name=ads id=ads src=’/ads/fullbanner/ad1/ad.html’ width=468 height=60 marginwidth=0 marginheight=0 frameborder=0 hspace=0 vspace=0 border=0 scrolling=no>Cant do inline frames.</iframe>

There’s not much to the html thats being loaded into this iframe. Here’s one of the files:
<html>
<head></head>
<body>
<center>
<a target=”_top” href=”http://www.blah.com“>
<img border=0 name=”ad1″ width=468 height=60 src=”/ads/fullbanner/ad1/blah.jpg”></a>
</center>
</body>
</html>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@JupacSep 21.2004 — Best to do it server side. does your server support server-side?
Copy linkTweet thisAlerts:
@apcharauthorSep 21.2004 — They do support server side includes but (for reasons I dont understand) the pages load so much more slowly than with this approach. Besides, my site uses frames. So the banner frame doesn't reload everytime the user clicks something. I have to trigger my rotate() function from other frames. I dont know how else to inject an html file into the middle of a page after the page is already loaded except to use an inline frame.

Art.
Copy linkTweet thisAlerts:
@JupacSep 22.2004 — i mean server side langugae php,asp.net etc
Copy linkTweet thisAlerts:
@apcharauthorSep 23.2004 — The ad is in its own frame. Is there some way for javascript in one frame to tell another frame to reload? I can see how that could work. The browser would think it's reloading the same .php file while I could do the random selection on the server.
×

Success!

Help @apchar spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...