Javascript and Netscape 4.7

Discussion in 'Javascript' started by Cenékemoi, Sep 24, 2003.

  1. Cenékemoi

    Cenékemoi Guest

    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
     
    Cenékemoi, Sep 24, 2003
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Sep 24, 2003
    #2
    1. Advertising

  3. Cenékemoi

    Dom Leonard Guest

    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
     
    Dom Leonard, Sep 24, 2003
    #3
  4. Cenékemoi

    Cenékemoi Guest

    Bonjour (from France) à Dom Leonard
    <> 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 ;-)
     
    Cenékemoi, Sep 24, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    506
  2. Mickey Segal
    Replies:
    1
    Views:
    675
    Mickey Segal
    May 21, 2004
  3. yaktipper
    Replies:
    10
    Views:
    289
    Richard Cornford
    Jul 10, 2003
  4. Thomas Revor

    Javascript, signing, and Netscape 7

    Thomas Revor, Sep 4, 2003, in forum: Javascript
    Replies:
    1
    Views:
    142
    Martin Honnen
    Sep 4, 2003
  5. SabMan
    Replies:
    2
    Views:
    117
    Lasse Reichstein Nielsen
    Dec 6, 2003
Loading...

Share This Page