By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,354 Members | 603 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,354 IT Pros & Developers. It's quick & easy.

break iframe script not working with banner rotator

P: 1
Hello All,

I am normally great at figuring out ways around iframe issues that frustrate us all.
I am using javasript to try and break an iframe that I have a banner rotator embedded in but it is not working. I want visitors to click the banners and actually be taken to those pages instead of the new page being stuck in the iframe. What ever the case when I click on any banner, it opens the url right there inside the frame instead of breaking out ontop. Nothing I do seems to work. I even tried to alter the javascript for the ad rotator a little to look like:

<script language="javascript">
banner1 = new Banner('banner1');
banner1.add("IMAGE", "v4.png", 5, 600, 160,"url" target="_blank");
banner1.add("IMAGE", "v3.jpg", 5, 600, 160,"url" target="_blank");
banner1.add("IMAGE", "v4.png", 5, 600, 160,"url" target="_blank");
banner1.add("IMAGE", "v5.jpg", 5, 600, 160,"url" target="_blank");
banner1.add("IMAGE", "v4.png", 5, 600, 160,"url" target="_blank");

document.write(banner1);
banner1.start();
</script>

Otherwise in the <head>on the html page that the iframe is on, I am using

<script language= "JavaScript">
<!--Break out of frames
if (top.frames.length!=0)
top.location=self.document.location;
//-->
</script>

The iframe itself is:
<IFRAME NAME="uwp" SRC="url"
ALLOWTRANSPARENCY="true" frameborder="0" width="175" height="640"></iframe>

Essentially, when visitors click on banners, I want them taken to the actual site and not stuck inside the frame. Any help would be appreciated!

Kwenterprise
Apr 3 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 10K+
P: 11,448
I moved this post to a more appropriate forum.

kind regards,

Jos (Java forum moderator)
Apr 3 '07 #2

acoder
Expert Mod 15k+
P: 16,027
This should actually be in the main Javascript forum.
May 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.