SunQuest
           HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 26th, 2000, 03:41 PM
tennisguy tennisguy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2000
Location: Cleveland
Posts: 16 tennisguy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi!

I need to find a way to open up a new window when ever a user clicks on a link in a iframe that I do not control.

The contents of the frame are advertising banners for flycast - some are rich media. I do NOT have access to the contents of the iframe. As a result, I do not have access to the <A HREF...> code in the iframe either.
Is there any way that can be done? (i.e. with Onclick?) Please be through when posting any sample code as I am a complete Javascript newbie (I always use php - but this time flycast has chosen javascript)

Here is the flycast banner code:

FlycastLoaded = true;
FlycastRandom = 0;
FlycastFoundMSIE = navigator.userAgent.indexOf("MSIE") >= 0;
FlycastFoundMSIE2 = navigator.userAgent.indexOf("MSIE2") >= 0 | | navigator.userAgent.indexOf("MSIE 2") >= 0;
FlycastFoundMSIE3 = navigator.userAgent.indexOf("MSIE 3") >= 0;
FlycastFoundNN = navigator.userAgent.indexOf("Mozilla/") >= 0 && !FlycastFoundMSIE;
FlycastFoundNN2 = navigator.userAgent.indexOf("Mozilla/2.") >= 0 && !FlycastFoundMSIE;
FlycastFoundNN3 = navigator.userAgent.indexOf("Mozilla/3.") >= 0 && !FlycastFoundMSIE;

function FlycastDeliverAd () {

FlycastAdServer = "http://adex3.flycast.com/server";

if (FlycastNewAd) {
FlycastNow = new Date();
FlycastRandom = FlycastNow.getTime();
FlycastRandom = FlycastRandom % 10000000;
if (!(FlycastFoundNN2 | | FlycastFoundMSIE3))
FlycastRandom += Math.floor(Math.random() * 100);
}

FlycastSiteInfo = FlycastSite + "/" + FlycastPage + "/" + FlycastRandom;

if (FlycastFoundMSIE2) {
document.write('<A HREF="' + FlycastAdServer + '/click/' + FlycastSiteInfo + '"><IMG SRC="' + FlycastAdServer + '/ad/' + FlycastSiteInfo + '" scrolling="no" marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0 width=' + FlycastWidth + ' height=' + FlycastHeight + '></A>');
}
else if (FlycastFoundMSIE) {
document.write('<IFRAME SRC="' + FlycastAdServer + '/iframe/' + FlycastSiteInfo + '" scrolling="no" marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0 width=' + FlycastWidth + ' height=' + FlycastHeight + '></IFRAME>');
}
else {
document.write('<S' + 'CRIPT SRC="' + FlycastAdServer + '/js/' + FlycastSiteInfo + '" LANGUAGE=JAVASCRIPT></SCRIPT>');
}
}

if (FlycastFoundNN3 && FlycastPrintTag) {
FlycastLoaded = false;
FlycastDeliverAd();
}

Sorry if the code got messed up in the posting...

Thanks!!!

Reply With Quote
  #2  
Old February 29th, 2000, 05:19 AM
Ramon Ramon is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 1999
Location: Helden,Limburg,The Netherlands
Posts: 33 Ramon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
If you do not have access to the source to change it it is not possible to control with JavaScript what happens when someone clicks on an area on another page.

This is not possible because of obvious security issues.


------------------
Ramon Litjens
Boradoli Web Design
(www.boradoli.nl)

Reply With Quote
  #3  
Old March 21st, 2000, 09:32 AM
sbarre sbarre is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Posts: 3 sbarre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
In IE5 you should be able to put an onClick="return dosomethinghere()" statement in the IFRAME tag that you include in your page that contains the ad..

Since it looks like the IFRAME is being generated by the Javascript, you would have to edit their script code, which might be against your terms of service with Flycast..

You could also enclose the whole mess in a <DIV> and put an onclick statement in your DIV.. With even bubbling, even if they click on something inside the DIV, the event will bubble back up to the DIV eventually..

hope this helps..

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Help with opening a new window in a frame that I do not control


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway