473,387 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 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 2118
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.