Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Javascript and Netscape 4.7

Reply
Thread Tools

Javascript and Netscape 4.7

 
 
Cenékemoi
Guest
Posts: n/a
 
      09-24-2003
Hello,

excuse me in advance for my poor english...

I have a problem with NS 4.7 (I know, it is old, but I have no
choice...) :

So, I have a page with a link to open a new window:

var strHtml = '<html><head><title>title_of_window</title>' +
'<LINK rel=stylesheet href=theme.css>'+
'<SCRIPT LANGUAGE="JavaScript" SRC="my_script.js"></SCRIPT>' +
'</HEAD><BODY onLoad="fonc_onLoad();" class=Body topmargin=0
leftmargin=0 MARGINWIDTH=0 MARGINHEIGHT=0>' +
'blablabla' +
'</body></html>';

var win = window.open('', 'window_name', 'parameters');
win.document.write(strHtml);
win.document.close();
win.focus();


My problem concerns the tag "onLoad " of the "BODY" tag: with IE, the
"fonc_onLoad()" starts normally (this function is in "my_script.js"),
but with NS 4.7 (ou 4.51), the <SCRIPT> tag is ignored (you can view the
window's source code), so the "fonc_onLoad()" function cannot not start.

Any help would be highly appreciated.
Thank you very much in advance.

--
Yours sincerely, Thierry

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-24-2003


Cenékemoi wrote:

> Hello,
>
> excuse me in advance for my poor english...
>
> I have a problem with NS 4.7 (I know, it is old, but I have no
> choice...) :
>
> So, I have a page with a link to open a new window:
>
> var strHtml = '<html><head><title>title_of_window</title>' +
> '<LINK rel=stylesheet href=theme.css>'+
> '<SCRIPT LANGUAGE="JavaScript" SRC="my_script.js"></SCRIPT>' +
> '</HEAD><BODY onLoad="fonc_onLoad();" class=Body topmargin=0
> leftmargin=0 MARGINWIDTH=0 MARGINHEIGHT=0>' +
> 'blablabla' +
> '</body></html>';
>
> var win = window.open('', 'window_name', 'parameters');
> win.document.write(strHtml);
> win.document.close();
> win.focus();
>
>
> My problem concerns the tag "onLoad " of the "BODY" tag: with IE, the
> "fonc_onLoad()" starts normally (this function is in "my_script.js"),
> but with NS 4.7 (ou 4.51), the <SCRIPT> tag is ignored (you can view the
> window's source code), so the "fonc_onLoad()" function cannot not start.
>
> Any help would be highly appreciated.
> Thank you very much in advance.


Try to insert some dummy script e.g.
strHTML = '<html><head><title>...<\/title>'
+ '<script type="text/javascript">var dummy = 1;<\/script>'
+ '...'
that sometimes helps that NN4 recognizes your script

--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Dom Leonard
Guest
Posts: n/a
 
      09-24-2003


Salut de l'australie...

Thierry wrote:

> I have a problem with NS 4.7
>
> I have a page with a link to open a new window:
>
> var strHtml = '<html><head><title>title_of_window</title>' +
> '<LINK rel=stylesheet href=theme.css>'+
> '<SCRIPT LANGUAGE="JavaScript" SRC="my_script.js"></SCRIPT>' +


The first problem occurs here:
</SCRIPT>
will terminate parsing of the javascript block in which this code has
been written. It needs to be escaped to
<\/SCRIPT>
even though it occurs within a quoted string.

> '</HEAD><BODY onLoad="fonc_onLoad();" class=Body topmargin=0
> leftmargin=0 MARGINWIDTH=0 MARGINHEIGHT=0>' +
> 'blablabla' +
> '</body></html>';
>
> var win = window.open('', 'window_name', 'parameters');
> win.document.write(strHtml);
> win.document.close();
> win.focus();
>
>


There are two more related problems that I know of:

a) When writing "<\/SCRIPT>" within generated content, it needs to be
the last thing written in a single call to document.write. If not, NS4
can produce layout errors. If necessary, break up strHTML into pieces
and write them separately. I can not say that this bug will affect your
page for sure, but the bug certainly exists.


b) NS4 has trouble loading external javascript files within pages
generated by pages loaded using the "file://" protocol. Testing this
page most likely needs to be done using a server.
(For testing on my local machine, I use Personal Web Server (PWS) under
Windows 98, or Appache under Windows XP.)


amicalement,

Dom



 
Reply With Quote
 
Cenékemoi
Guest
Posts: n/a
 
      09-24-2003
Bonjour (from France) ŕ Dom Leonard
<(E-Mail Removed)> qui nous a
écrit :
> Salut de l'australie...
>
> There are two more related problems that I know of:
>
> a) When writing "<\/SCRIPT>" within generated content, it needs to
> be the last thing written in a single call to document.write. If not,
> NS4 can produce layout errors. If necessary, break up strHTML into
> pieces and write them separately. I can not say that this bug will
> affect your page for sure, but the bug certainly exists.


here, it is not necessary...

> b) NS4 has trouble loading external javascript files within pages
> generated by pages loaded using the "file://" protocol. Testing this
> page most likely needs to be done using a server.


Thank you very much, you are right !...

> (For testing on my local machine, I use Personal Web Server (PWS)
> under Windows 98, or Appache under Windows XP.)
>
>
> amicalement,
>
> Dom


--
Cordialement, Thierry

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Netscape 7.1 to Netscape 8 Skid Schermerhorn Firefox 2 09-05-2005 04:04 PM
Accessing Netscape mail via Netscape mail client A. Toprak Computer Support 0 12-24-2004 06:46 AM
Netscape with JRE 1.5 beta 1 ignores Netscape signing Mickey Segal Java 1 05-21-2004 01:52 PM
websphere, oracle, netscape: netscape timeout Tom Java 0 08-01-2003 11:03 PM
How to disable right click menu in IE, Netscape 4 and Netscape 6 yaktipper Javascript 10 07-10-2003 04:15 PM



Advertisments