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

    Join Date
    Aug 2003
    Posts
    4
    Rep Power
    0

    Angry Javascript and Frame Problem


    I have a link in a frame and when visitor clicks on the link, the target page opens in the same frame.
    I have tried the <base target="_blank"> within the head.

    Because the link in out of my control and it is coming from a Javascript source from outside source; can anyone tell me to enforce the link to get open in a new window?

    Regards
    Bacha
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    11
    Rep Power
    0
    what do you mean?
    are you linking to an page outside of your site?
    and you want this new page to open in a new window?
  4. #3
  5. Insignificant Peon
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Tharsis Ridge (Martian lowlands)
    Posts
    194
    Rep Power
    12
    Because the link in out of my control and it is coming from a Javascript source from outside source
    Well, many 3rd party scripts are out of your control, as you say. But many can be manipulated as well. However, there is no way I or anyone else can tell if there is a way to manipulate the code unless we SEE the script in question.

    So, either post the entire source code of the external script you are linking to here in this thread, or provide a link to the page that you have the script residing on, so that we can examine the source code there.
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    4
    Rep Power
    0

    Target Frame


    The code is simple:

    <script language=javascript src=http://www.website.com/text.js></script>
    That is it.

    My question is that this script creates a link and when visitor clicks on that link it opens in the same frame.

    Is there a way to enforce the link to get opened in a new window? (I used the HTML target="_blank" but it doesn't work).

    Regards
  8. #5
  9. Insignificant Peon
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Tharsis Ridge (Martian lowlands)
    Posts
    194
    Rep Power
    12
    <script language=javascript src=http://www.website.com/text.js></script>
    That is it.
    No. That is not "it".

    Here's the deal... instead of posting non-existent text.js at existing www.website.com, post the real deal. I (or somebody else) can grab the real .js file, look at it to see WHERE we can recode it to allow target="_blank" (to open in a seperate window). Then by adding a BASE HREF tag pointing to the "real" www.website.com site (if website.com is not the real site), you can have the result you are looking for.

    That is only a one-case scenario. There may be another method. But I need to see the REAL .js file, and not an example as you posted. As I said in my first post, there is no way I or anyone else can tell if there is a way to manipulate the code unless we SEE the script in question.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    4
    Rep Power
    0

    Frame Problem


    Hi,
    Here is the code that Javascript Prints:
    Here the code they have provided to me to put in an html page:
    <script type="text/javascript"><!--
    google_ad_client = "pub-28547";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>

    And here is the page the above .js has created. It acts like an IFRAME a complete HTML page.
    -----------------------
    <html>
    <head>
    <style><!--
    .ch{cursorointer;cursor:hand}a.ad:link { color: #0000ff }a.ad:visited { color: #0000ff }a.ad:hover { color: #0000ff }a.ad:active { color: #0000ff }a.search:link { color: #ffffff }a.search:visited { color: #ffffff }a.search:hover { color: #ffffff }a.search:active { color: #ffffff }a.attribution:link { color: #ffffff }a.attribution:visited { color: #ffffff }a.attribution:hover { color: #ffffff }a.attribution:active { color: #ffffff }//--></style><script><!--
    function ss(w){window.status=w;return true;}function cs(){window.status='';}function ca(a){ top.location.href=document.getElementById(a).href;}function ga(o,e) {if (document.getElementById) {a=o.id.substring(1);p = "";r = "";g = e.target;if (g) {t = g.id;f = g.parentNode;if (f) {p = f.id;h = f.parentNode;if (h)r = h.id;}} else {h = e.srcElement;f = h.parentNode;if (f)p = f.id;t = h.id;}if (t==a || p==a || r==a)return true;top.location.href=document.getElementById(a).href}}//-->
    </script>
    </head>
    <body bgColor="#ffffff" leftMargin="0" topMargin="0" marginwidth="0" marginheight="0">
    <table width="468" height="60" cellspacing="1" cellpadding="0" border="0" bgcolor="#336699"><tr><td>
    <table width="466" height="58" cellspacing="0" cellpadding="1" border="0" bgcolor="#ffffff">
    <tr>
    <td colspan="2" width="" height="">
    <table width="464" height="" cellspacing="0" cellpadding="2" border="0"><tr><td id="taw0" class="ch" width="229" height="41" align="left" valign="top" onMouseOver="ss('go to Sounddogs.com')" onMouseOut="cs()" onClick="ga(this,event)"><font style="font-size:11px; font-family:verdana,arial,sans-serif;"><a class="ad" id="aw0" target="_top" href="http://pagead2.secondcup.com/url?q=http://www.sounddogs.com/searchresults.asp%3FKeyword%3DOrchestral%2520Large&sa=l&ai=AqroRARpQ_I_92YJkhwYmgicCK697BYqk-bAwNebAMEw5cXfAAA99HEgABwMEAA&num=1&client=ca-pub-28547" onMouseOver="return ss('go to Sounddogs.com')" onMouseOut="cs()"><b>Download Production Music</b></a></font><br><font style="font-size:10px; font-family:verdana,arial,sans-serif; color:">30000 Royalty-Free Music Tracks Aif, Wav, Mp3, or Packaged CD&#39;s </font>
    </td>
    <td id="taw1" class="ch" width="229" height="41" align="left" valign="top" onMouseOver="ss('go to www.kazaagold.com')" onMouseOut="cs()" onClick="ga(this,event)"><font style="font-size:11px; font-family:verdana,arial,sans-serif;"><a class="ad" id="aw1" target="_top" href="http://pagead2.secondcup.com/url?q=http://www.kazaagold.com&sa=l&ai=A2WQYARpQ_I_92YJkhwYmgicCDHonCMbl9XAwNebAMIw5cXfAAALzLEgACwMEAA&num=2&clie nt=ca-pub-28547" onMouseOver="return ss('go to www.kazaagold.com')" onMouseOut="cs()"><b>Free Kazaa Gold</b></a></font><br><font style="font-size:10px; font-family:verdana,arial,sans-serif; color:">Faster Downloads, No Advertising No Subscription Fees, 100% Private </font>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>
    --------------------------------------- end of the code ------

    Remember we can't change this code. Only is there is a way, we can enforce link click.

    Hope you can solve this.

    Regards

IMN logo majestic logo threadwatch logo seochat tools logo