#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Location
    Cleveland
    Posts
    16
    Rep 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 &#0124; &#0124; 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 &#0124; &#0124; 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!!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    16
    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)
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    3
    Rep 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..

Similar Threads

  1. opening link in a new window
    By Avi in forum Java Help
    Replies: 2
    Last Post: December 3rd, 2004, 09:40 AM
  2. Trouble 'opening page' in another frame in IE6
    By wallacevt in forum HTML Programming
    Replies: 0
    Last Post: February 13th, 2004, 10:21 AM
  3. Target of pop-up window form as a frame in the main window
    By tsramkumar in forum HTML Programming
    Replies: 2
    Last Post: February 10th, 2004, 10:44 AM
  4. Replies: 0
    Last Post: February 28th, 2002, 04:12 PM
  5. Closing a pop up window on load of a different frame
    By mking in forum HTML Programming
    Replies: 0
    Last Post: November 17th, 2000, 02:10 AM

IMN logo majestic logo threadwatch logo seochat tools logo