472,789 Members | 1,305 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

document,write opens a new window instead!

Hi,
I have a page with this frameset:

<frameset cols="185,800*" frameborder="YES" border="2"
framespacing="2" rows="*" bordercolor="#FF0000">
<frame name="leftFrame" noresize src="SpagnoloLeftFrame.html">
<frame name="mainFrame" src="SpagnoloIntro.html">

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

<h5>
<center>
<script language="Javascript">
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="mainFrame".

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.
Jul 23 '05 #1
2 2086
Lee
PhoneLover said:

Hi,
I have a page with this frameset:

<frameset cols="185,800*" frameborder="YES" border="2"
framespacing="2" rows="*" bordercolor="#FF0000">
<frame name="leftFrame" noresize src="SpagnoloLeftFrame.html">
<frame name="mainFrame" src="SpagnoloIntro.html">

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

<h5>
<center>
<script language="Javascript">
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="mainFrame".

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.


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

Jul 23 '05 #2
Lee <RE**************@cox.net> wrote in message
Your variable named "name" is changing the name of that frame.
Use a different name than "name".


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!
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: James Marshall | last post by:
I'm writing a library where I want to override document.write(), but for all document objects; thus, I want to put it in the prototype. I tried Document.prototype.write= my_doc_write ; but it...
1
by: Nat | last post by:
Hi I have following code: ----------------- protected override void Render(HtmlTextWriter w) { if (helpString!=null) { w.Write("<span class='tooltipiconouter'><img title =...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
9
by: Mike Preston | last post by:
IE 6.0 (not interested in other browsers at the moment) I have looked everywhere I can find to look and googled until I am cross-eyed and am hoping somebody knows what I'm doing wrong. I have...
4
by: Bernard | last post by:
Hi, I am suddenly getting Safari script errors with the following user agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8 In a...
2
by: Bruce | last post by:
I have sucessfully used document.write in a new window, but I now wish to write to an already open & framed window. How do I do it. Please show example, as I have trouble getting my head around JS....
7
by: Remi Bastide | last post by:
I'm trying to open a blank window and write a message in it. The following page works as expected in IE, but in Firefox the message is not written: <HTML> <HEAD> <TITLE>Document.write...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
6
by: mistral | last post by:
what is correct way open a PDF document in new window use hyperlink? I want show images thumbnails linked with PDF files, when click on thumbnail, PDF will be opened in new window. Some of PDF...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.