document,write opens a new window instead!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • PhoneLover

    #1

    document,write opens a new window instead!

    Hi,
    I have a page with this frameset:

    <frameset cols="185,800*" frameborder="YE S" border="2"
    framespacing="2 " rows="*" bordercolor="#F F0000">
    <frame name="leftFrame " noresize src="SpagnoloLe ftFrame.html">
    <frame name="mainFrame " src="SpagnoloIn tro.html">

    in SpagnoloIntro.h tml I have put this javascript code (in the body):

    <h5>
    <center>
    <script language="Javas cript">
    name = 'xxxx';
    domain = 'mysite.com;
    nuovo=document. open();
    nuovo.document. write('<a href="MailTo:' + name + '@' + domain
    + '">' + name + '@' + domain +'</a>');
    nuovo.document. close();
    </script>
    </center></h5>

    'cos I don't want spammers to get my e-mail address.
    The problem is, when I click on a link in the "leftFrame" frame, a new
    window is open with the content of the link, instead of going to
    target="mainFra me".

    If I do not put the javascript code, the rightFrame gets the content
    of the leftFrame link, exactly as I wish.

    Could you please tell me why? I really can't come to a solution which
    is driving me crazy.

    Thanks!
    John.
  • Lee

    #2
    Re: document,write opens a new window instead!

    PhoneLover said:[color=blue]
    >
    >Hi,
    >I have a page with this frameset:
    >
    ><frameset cols="185,800*" frameborder="YE S" border="2"
    >framespacing=" 2" rows="*" bordercolor="#F F0000">
    > <frame name="leftFrame " noresize src="SpagnoloLe ftFrame.html">
    > <frame name="mainFrame " src="SpagnoloIn tro.html">
    >
    >in SpagnoloIntro.h tml I have put this javascript code (in the body):
    >
    ><h5>
    > <center>
    > <script language="Javas cript">
    >name = 'xxxx';
    >domain = 'mysite.com;
    >nuovo=document .open();
    >nuovo.document .write('<a href="MailTo:' + name + '@' + domain
    > + '">' + name + '@' + domain +'</a>');
    >nuovo.document .close();
    ></script>
    ></center></h5>
    >
    >'cos I don't want spammers to get my e-mail address.
    >The problem is, when I click on a link in the "leftFrame" frame, a new
    >window is open with the content of the link, instead of going to
    >target="mainFr ame".
    >
    >If I do not put the javascript code, the rightFrame gets the content
    >of the leftFrame link, exactly as I wish.
    >
    >Could you please tell me why? I really can't come to a solution which
    >is driving me crazy.[/color]

    Your variable named "name" is changing the name of that frame.
    Use a different name than "name".

    Comment

    • PhoneLover

      #3
      Re: document,write opens a new window instead!

      Lee <REM0VElbspamtr ap@cox.net> wrote in message
      [color=blue]
      > Your variable named "name" is changing the name of that frame.
      > Use a different name than "name".[/color]

      Shheezzz, how the hell did you see this?!
      I have changed "name" into "nome" (in italian) and now everything works perfectly.

      Great job indeed! Would have NEVER seen this. Thank you very much!
      Ciao!

      Comment

      Working...