JavaScript doesnt run on netscape 7.1

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gaurav

    #1

    JavaScript doesnt run on netscape 7.1

    Hello,

    i have some java script with in html. It runs fine on IE 6.0 but
    doesnt run on netscape 7.1

    Can someone tell me whats the problem ? And how can i solve it.

    here is the url



    thank you in advance.

    Gaurav
  • Lee

    #2
    Re: JavaScript doesnt run on netscape 7.1

    Gaurav said:[color=blue]
    >
    >Hello,
    >
    >i have some java script with in html. It runs fine on IE 6.0 but
    >doesnt run on netscape 7.1
    >
    >Can someone tell me whats the problem ? And how can i solve it.
    >
    >here is the url
    >
    >http://godot.urol.uic.edu/output.html[/color]

    The error message in Netscape 7.1 is that "o" is not defined
    in line 127.

    As soon as you use document.write( ) to change the contents of
    the page, the entire previous page is erased, including your
    javascript variables.

    I didn't look at your code any more closely than to see the
    problem, but you could probably fix it by accumulating all
    of the HTML that you want to write in a string variable, and
    then using document.write( ) once, to write the value of that
    variable.

    Comment

    • DU

      #3
      Re: JavaScript doesnt run on netscape 7.1

      Gaurav wrote:[color=blue]
      > Hello,
      >
      > i have some java script with in html. It runs fine on IE 6.0 but
      > doesnt run on netscape 7.1
      >
      > Can someone tell me whats the problem ? And how can i solve it.
      >
      > here is the url
      >
      > http://godot.urol.uic.edu/output.html
      >
      > thank you in advance.
      >
      > Gaurav[/color]

      Your markup code needs to be fixed first. You should quote all your
      attribute values.
      http://www.htmlhelp.org/faq/html/basics.html#quotes
      "By default, SGML requires that all attribute values be delimited using
      either double quotation marks (...)"
      http://www.w3.org/TR/html4/intro/sgm...tml#attributes
      Why attribute values should always be quoted in HTML

      <form> needs an action attribute. type can not be number, etc... Also,
      you need to define a charset:
      http://www.htmlhelp.com/tools/validator/charset.html
      Choose a doctype declaration (preferably strict DTD) like

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">

      then define the character set and finally validate your document. Once
      your document is perfectly valid, it will work in all web standard
      compliant browsers and your webpage script functions difficulties can be
      fixed with a lot more ease.

      Activating the Right Layout Mode Using the Doctype Declaration
      Aalto University, Finland is a new multidisciplinary science and art community in the fields of science, business, and art and design.


      W3C validator
      http://validator.w3.org/

      Why we won't help you


      DU
      --
      Javascript and Browser bugs:

      - Resources, help and tips for Netscape 7.x users and Composer
      - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


      Comment

      • John G Harris

        #4
        Re: JavaScript doesnt run on netscape 7.1

        In article <bloc9j$aog$1@n ews.eusc.inter. net>, DU
        <drunclear@ho t-R-E-M-O-V-E-mail.com> writes
        <snip>[color=blue]
        >"By default, SGML requires that all attribute values be delimited using
        >either double quotation marks (...)"[/color]

        The HTML spec then goes on to say :

        "In certain cases, authors may specify the value of an attribute
        without any quotation marks. The attribute value may only contain
        letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45),
        periods (ASCII decimal 46), underscores (ASCII decimal 95), and
        colons (ASCII decimal 58). We recommend using quotation marks even
        when it is possible to eliminate them."
        [color=blue]
        >http://www.w3.org/TR/html4/intro/sgm...tml#attributes[/color]

        You should at least quote the latest issue : it's now HTML 4.01.

        <snip>

        John
        --
        John Harris

        Comment

        • Lasse Reichstein Nielsen

          #5
          Re: JavaScript doesnt run on netscape 7.1

          John G Harris <john@nospam.de mon.co.uk> writes:
          [color=blue]
          > The HTML spec then goes on to say :[/color]
          ....

          Yes? Are you disagreeing that this is a relevant link when telling
          people to quote their attribute values?
          [color=blue]
          > You should at least quote the latest issue : it's now HTML 4.01.[/color]

          It *is* the latest issue.
          <URL:http://www.w3.org/TR/html4/intro/sgmltut.html#at tributes>
          and
          <URL:http://www.w3.org/TR/html401/intro/sgmltut.html#at tributes>
          both refer to the exact same document. If you follow the <link
          rel="contents">-link, you get to the front page of the HTML 4.01
          specification.
          It is also avalable as
          <URL:http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html#h-3.2.2>
          which is apparently the official link.

          The actual HTML 4.0 specification would have been this link:
          <URL:http://www.w3.org/TR/1998/REC-html40-19980424/intro/sgmltut.html#h-3.2.2>


          /L
          --
          Lasse Reichstein Nielsen - lrn@hotpop.com
          Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
          'Faith without judgement merely degrades the spirit divine.'

          Comment

          • DU

            #6
            Re: JavaScript doesnt run on netscape 7.1

            John G Harris wrote:[color=blue]
            > In article <bloc9j$aog$1@n ews.eusc.inter. net>, DU
            > <drunclear@ho t-R-E-M-O-V-E-mail.com> writes
            > <snip>
            >[color=green]
            >>"By default, SGML requires that all attribute values be delimited using
            >>either double quotation marks (...)"[/color]
            >
            >
            > The HTML spec then goes on to say :
            >
            > "In certain cases, authors may specify the value of an attribute
            > without any quotation marks. The attribute value may only contain
            > letters (a-z and A-Z), digits (0-9), hyphens (ASCII decimal 45),
            > periods (ASCII decimal 46), underscores (ASCII decimal 95), and
            > colons (ASCII decimal 58). We recommend using quotation marks even
            > when it is possible to eliminate them."
            >[/color]

            Yes. That is why I used (...) to indicate further reading. Is there a
            problem with that?
            [color=blue]
            >[color=green]
            >>http://www.w3.org/TR/html4/intro/sgm...tml#attributes[/color]
            >
            >
            > You should at least quote the latest issue : it's now HTML 4.01.
            >[/color]

            But on this precise issue, the HTML 4.01 TR does not differ at all from
            HTML 4.0 TR. And the link will point to the same reference. So, what is
            your point exactly?

            DU
            --
            Javascript and Browser bugs:

            - Resources, help and tips for Netscape 7.x users and Composer
            - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


            Comment

            • Gaurav

              #7
              Re: JavaScript doesnt run on netscape 7.1

              Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<bloa5b0vu t@drn.newsguy.c om>...[color=blue]
              > Gaurav said:[color=green]
              > >
              > >Hello,
              > >
              > >i have some java script with in html. It runs fine on IE 6.0 but
              > >doesnt run on netscape 7.1
              > >
              > >Can someone tell me whats the problem ? And how can i solve it.
              > >
              > >here is the url
              > >
              > >http://godot.urol.uic.edu/output.html[/color]
              >
              > The error message in Netscape 7.1 is that "o" is not defined
              > in line 127.
              >
              > As soon as you use document.write( ) to change the contents of
              > the page, the entire previous page is erased, including your
              > javascript variables.
              >
              > I didn't look at your code any more closely than to see the
              > problem, but you could probably fix it by accumulating all
              > of the HTML that you want to write in a string variable, and
              > then using document.write( ) once, to write the value of that
              > variable.[/color]

              *************** **********

              Thank you..I tried using string variable and now it works fine in
              netscape 7.1

              There is one problem left though, my page keeps loading endlessly even
              though it has spitted out the output.

              Comment

              • Lee

                #8
                Re: JavaScript doesnt run on netscape 7.1

                Gaurav said:[color=blue]
                >
                >Lee <REM0VElbspamtr ap@cox.net> wrote in message
                >news:<bloa5b0v ut@drn.newsguy. com>...[color=green]
                >> Gaurav said:[color=darkred]
                >> >
                >> >Hello,
                >> >
                >> >i have some java script with in html. It runs fine on IE 6.0 but
                >> >doesnt run on netscape 7.1
                >> >
                >> >Can someone tell me whats the problem ? And how can i solve it.
                >> >
                >> >here is the url
                >> >
                >> >http://godot.urol.uic.edu/output.html[/color]
                >>
                >> The error message in Netscape 7.1 is that "o" is not defined
                >> in line 127.
                >>
                >> As soon as you use document.write( ) to change the contents of
                >> the page, the entire previous page is erased, including your
                >> javascript variables.
                >>
                >> I didn't look at your code any more closely than to see the
                >> problem, but you could probably fix it by accumulating all
                >> of the HTML that you want to write in a string variable, and
                >> then using document.write( ) once, to write the value of that
                >> variable.[/color]
                >
                >************** ***********
                >
                >Thank you..I tried using string variable and now it works fine in
                >netscape 7.1
                >
                >There is one problem left though, my page keeps loading endlessly even
                >though it has spitted out the output.[/color]

                After you document.write( ) the string, issue:
                document.close( );
                So Netscape knows you're done writing.

                Comment

                • John G Harris

                  #9
                  Re: JavaScript doesnt run on netscape 7.1

                  In article <blpte9$4cg$1@n ews.eusc.inter. net>, DU
                  <drunclear@ho t-R-E-M-O-V-E-mail.com> writes
                  <snip>[color=blue]
                  >Yes. That is why I used (...) to indicate further reading. Is there a
                  >problem with that?[/color]
                  <snip>

                  If you'd said that it is wiser or better to put quotes round attribute
                  values I would agree with you. If you'd also said that it saves having
                  to remember when quotes really are needed I wouldn't have commented.

                  As it is, you implied that missing out the quotes is wrong, which could
                  confuse people.

                  John
                  --
                  John Harris

                  Comment

                  • Gaurav

                    #10
                    Re: JavaScript doesnt run on netscape 7.1

                    Lee <REM0VElbspamtr ap@cox.net> wrote in message news:<blsc3v01f b4@drn.newsguy. com>...[color=blue]
                    > Gaurav said:[color=green]
                    > >
                    > >Lee <REM0VElbspamtr ap@cox.net> wrote in message
                    > >news:<bloa5b0v ut@drn.newsguy. com>...[color=darkred]
                    > >> Gaurav said:
                    > >> >
                    > >> >Hello,
                    > >> >
                    > >> >i have some java script with in html. It runs fine on IE 6.0 but
                    > >> >doesnt run on netscape 7.1
                    > >> >
                    > >> >Can someone tell me whats the problem ? And how can i solve it.
                    > >> >
                    > >> >here is the url
                    > >> >
                    > >> >http://godot.urol.uic.edu/output.html
                    > >>
                    > >> The error message in Netscape 7.1 is that "o" is not defined
                    > >> in line 127.
                    > >>
                    > >> As soon as you use document.write( ) to change the contents of
                    > >> the page, the entire previous page is erased, including your
                    > >> javascript variables.
                    > >>
                    > >> I didn't look at your code any more closely than to see the
                    > >> problem, but you could probably fix it by accumulating all
                    > >> of the HTML that you want to write in a string variable, and
                    > >> then using document.write( ) once, to write the value of that
                    > >> variable.[/color]
                    > >
                    > >************** ***********
                    > >
                    > >Thank you..I tried using string variable and now it works fine in
                    > >netscape 7.1
                    > >
                    > >There is one problem left though, my page keeps loading endlessly even
                    > >though it has spitted out the output.[/color]
                    >
                    > After you document.write( ) the string, issue:
                    > document.close( );
                    > So Netscape knows you're done writing.[/color]

                    %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% %%%

                    Thank you . I tried document.close and now netscape 7.1 stops after
                    running the script.

                    I am facing another problem that is specific to netscape 7.1
                    Background color of the webpage is not coming out correctly.

                    If i use IE 6.0 or Netscape 6.0 it comes out fine.

                    Comment

                    • Lee

                      #11
                      Re: JavaScript doesnt run on netscape 7.1

                      Gaurav said:[color=blue]
                      >
                      >I am facing another problem that is specific to netscape 7.1
                      >Background color of the webpage is not coming out correctly.
                      >http://godot.urol.uic.edu/~gaurav/out.html
                      >If i use IE 6.0 or Netscape 6.0 it comes out fine.[/color]

                      Once the document exists, you can't set the bgColor attribute.

                      In the <head> section, add a style block:

                      <style type="text/css">
                      BODY {background-color:blue}
                      </style>

                      That should work for any modern browser.

                      Comment

                      • Lasse Reichstein Nielsen

                        #12
                        Re: JavaScript doesnt run on netscape 7.1

                        bansal2425@hotm ail.com (Gaurav) writes:
                        [color=blue]
                        > I am facing another problem that is specific to netscape 7.1
                        > Background color of the webpage is not coming out correctly.
                        > http://godot.urol.uic.edu/~gaurav/out.html[/color]

                        The offending line is

                        document.bgColo r="blue";

                        I don't know which standard this should come from, but it's not the
                        W3C DOM. It doesn't work in Opera 7 either.

                        What you should use is:
                        document.body.s tyle.background Color="blue";
                        Still, the problem is probably that at the time you execute the
                        line, the body doesn't exist yet.

                        If you wait until later:
                        <body onload='documen t.bgColor="blue ";'>
                        it works as you expect it to.

                        (other comments: the correct script start tag is
                        <script type="text/javascript"
                        The type attribute is *required* in HTML 4, while the language
                        attribute is deprecated.
                        You don't need HTML comments inside the script tag.)


                        /L
                        --
                        Lasse Reichstein Nielsen - lrn@hotpop.com
                        Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
                        'Faith without judgement merely degrades the spirit divine.'

                        Comment

                        • Gaurav

                          #13
                          Re: JavaScript doesnt run on netscape 7.1

                          Lasse Reichstein Nielsen <lrn@hotpop.com > wrote in message news:<n0ccn2ck. fsf@hotpop.com> ...[color=blue]
                          > bansal2425@hotm ail.com (Gaurav) writes:
                          >[color=green]
                          > > I am facing another problem that is specific to netscape 7.1
                          > > Background color of the webpage is not coming out correctly.
                          > > http://godot.urol.uic.edu/~gaurav/out.html[/color]
                          >
                          > The offending line is
                          >
                          > document.bgColo r="blue";
                          >
                          > I don't know which standard this should come from, but it's not the
                          > W3C DOM. It doesn't work in Opera 7 either.
                          >
                          > What you should use is:
                          > document.body.s tyle.background Color="blue";
                          > Still, the problem is probably that at the time you execute the
                          > line, the body doesn't exist yet.
                          >
                          > If you wait until later:
                          > <body onload='documen t.bgColor="blue ";'>
                          > it works as you expect it to.
                          >
                          > (other comments: the correct script start tag is
                          > <script type="text/javascript"
                          > The type attribute is *required* in HTML 4, while the language
                          > attribute is deprecated.
                          > You don't need HTML comments inside the script tag.)
                          >
                          >
                          > /L[/color]


                          did you mean
                          <body onload='documen t.body.style.ba ckgroundColor=" blue";'>

                          Comment

                          • Lasse Reichstein Nielsen

                            #14
                            Re: JavaScript doesnt run on netscape 7.1

                            bansal2425@hotm ail.com (Gaurav) writes:
                            [color=blue]
                            > did you mean
                            > <body onload='documen t.body.style.ba ckgroundColor=" blue";'>[/color]

                            Try it :)
                            It should work.
                            /L
                            --
                            Lasse Reichstein Nielsen - lrn@hotpop.com
                            Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
                            'Faith without judgement merely degrades the spirit divine.'

                            Comment

                            Working...