473,407 Members | 2,546 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,407 software developers and data experts.

include the same javascript in created code with secondWindow.document.writeln()

Hello,

I want to open a new window with javascript:
secondWindow=window.open(...)
secondWindow.document.writeln(...)

I wrote the javascript code into a separate file secondwindow.js.

I need in the new window the same javascript code, therefore:
secondWindow.document.writeln('<script type="text/javascript"
language="javascript1.2" src="../../js/secondwindow.js"><\/script>');

Just this line makes problems in Internet Explorer (without reaction),
not always and not in all Internet Explorer versions.
Netscape, Opera and Mozilla work without problems.

I tested successfully with w3c validator the XHTML code which created
with secondWindow.document.writeln().

What is the reason? How can I resolve this problem?
Thank you for your hints, Eels

Aug 20 '05 #1
2 1738
ASM
eels wrote:
Hello,

I want to open a new window with javascript:
secondWindow=window.open(...)
secondWindow.document.writeln(...)

I wrote the javascript code into a separate file secondwindow.js.
why won't you use mother's JS ?

opener.onefunction(arg1,arg2);
I need in the new window the same javascript code, therefore:
secondWindow.document.writeln('<script type="text/javascript"
language="javascript1.2" src="../../js/secondwindow.js"><\/script>');


try with something as follow :

var myCode = '<html><head><title>new window<\/title>'
myCode += '<script type="text/javascript" language="javascript1.2"'+
'src="../../js/secondwindow.js"><\/script>';
myCode += '<\/head><body>' // and so on ...

with(secondWindow.document) {
open();
write(myCode);
close();
}
If that doesn't solve your IE problems, could try with :
secondwindow.js">'+'<'+'/script>';
insteed of :
secondwindow.js"><\/script>';

'<'+'/head><body>'
insteed :
'<\/head><body>'

--
Stephane Moriaux et son [moins] vieux Mac
Aug 20 '05 #2
Hello,

the hint
var myCode = '<html><head><title>new window<\/title>'
myCode += '<script type="text/javascript" language="javascript1.2"'+
'src="../../js/secondwindow.js"><\/script>';
myCode += '<\/head><body>' // and so on ...

with(secondWindow.document) {
open();
write(myCode);
close();
} gives the solution.
Thank you Eeels.

ASM schrieb:
eels wrote:
Hello,

I want to open a new window with javascript:
secondWindow=window.open(...)
secondWindow.document.writeln(...)

I wrote the javascript code into a separate file secondwindow.js.


why won't you use mother's JS ?

opener.onefunction(arg1,arg2);
I need in the new window the same javascript code, therefore:
secondWindow.document.writeln('<script type="text/javascript"
language="javascript1.2" src="../../js/secondwindow.js"><\/script>');


try with something as follow :

var myCode = '<html><head><title>new window<\/title>'
myCode += '<script type="text/javascript" language="javascript1.2"'+
'src="../../js/secondwindow.js"><\/script>';
myCode += '<\/head><body>' // and so on ...

with(secondWindow.document) {
open();
write(myCode);
close();
}
If that doesn't solve your IE problems, could try with :
secondwindow.js">'+'<'+'/script>';
insteed of :
secondwindow.js"><\/script>';

'<'+'/head><body>'
insteed :
'<\/head><body>'

--
Stephane Moriaux et son [moins] vieux Mac


Aug 21 '05 #3

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

Similar topics

1
by: Patrick Gibbons | last post by:
What I would like to do is create header and footer information for my webpages which are created by calling from a referenced .js page . . . for example in Header.js: <script...
10
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load...
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
9
by: Robby Bankston | last post by:
I'm working on some code and am running into brick walls. I'm trying to write out Javascript with Javascript and I've read the clj Meta FAQ and didn't see the answer, read many similar posts (with...
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
2
by: Design2d | last post by:
Hi, if anyone can help with this I'd be very grateful: I'm generating an html popup window with Javascript. When the popup appears in Explorer 6.0 it is empty and crashes the browser, though it...
2
by: suhy | last post by:
Hi All, I use bellow code for Auto-Sizing Image Popup Window. It seems that it just stop working OK with IE7 as I didn't make any changes ... In the FF2.0 it still works great. You can see the...
15
by: dhtml | last post by:
Title says it. If I use a for in loop on an HTML collection, I get length twice. <!DOCTYPE HTML> <html lang="en"> <head> <title>length twice</title> </head> <body> <form...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.