"error on page"

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

    "error on page"

    How do you track down this to where the error actually is?

    TIA, Lee


  • frizzle

    #2
    Re: "error on page"

    Depends on the browser,
    in Internet Explorer for instance, you can double click
    on the error icon: left-lower corner, and view the details ...

    Comment

    • Randy Webb

      #3
      Re: "error on page"

      Lee David said the following on 7/21/2005 4:46 PM:[color=blue]
      > How do you track down this to where the error actually is?[/color]

      You read the error message. It states what the error is and what line it
      is on. To see the error message, in IE, you double click the Yellow !,
      in Mozilla you go Tools>Web Development>Jav ascript Console.

      --
      Randy
      comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

      Comment

      • Lee David

        #4
        Re: "error on page"

        Thank you. When I reopened the page it lead me directly to the "operator
        error" (my mistake) of not knowing how to spell "document" correctly. Now I
        just need to find out how to get the Netscape browser identified. This
        didn't work:

        if (document.layer s)
        {
        alert("**testin g** NS");
        var ns4test = true;
        var ie4test = false;
        }

        Nor did the more compact:
        ns4test = document.layers ?true:false;

        Again, thanks for the quick response... I'll put my shoe down and the
        monitor is safe again.

        Lee

        "frizzle" <phpfrizzle@gma il.com> wrote in message
        news:1121981773 .544782.231840@ g47g2000cwa.goo glegroups.com.. .[color=blue]
        > Depends on the browser,
        > in Internet Explorer for instance, you can double click
        > on the error icon: left-lower corner, and view the details ...
        >[/color]


        Comment

        • Randy Webb

          #5
          Re: &quot;error on page&quot;

          Lee David said the following on 7/21/2005 6:36 PM:
          [color=blue]
          > Thank you. When I reopened the page it lead me directly to the "operator
          > error" (my mistake) of not knowing how to spell "document" correctly. Now I
          > just need to find out how to get the Netscape browser identified. This
          > didn't work:[/color]

          Why does it matter if its Netscape, Mozilla, FunkyBrowser or
          myBrowserThatIM adeUpTheName? You don't browser detect, you feature detect.
          [color=blue]
          > if (document.layer s)
          > {
          > alert("**testin g** NS");
          > var ns4test = true;
          > var ie4test = false;
          > }
          >
          > Nor did the more compact:
          > ns4test = document.layers ?true:false;[/color]

          That actually "works", it just doesn't work the way you think it would.
          [color=blue]
          > Again, thanks for the quick response... I'll put my shoe down and the
          > monitor is safe again.[/color]

          if (document.layer s){
          //use the document.layers collection
          }

          if (document.getEl ementByID){
          //use the getElementByID method
          }

          if (document.all){
          //use the document.all collection
          }

          And all that without caring what browser it was. This is covered in the
          groups FAQ.

          And please don't top-post.

          --
          Randy
          comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
          Answer:It destroys the order of the conversation
          Question: Why?
          Answer: Top-Posting.
          Question: Whats the most annoying thing on Usenet?

          Comment

          • RobG

            #6
            Re: &quot;error on page&quot;

            Lee David wrote:
            [...][color=blue]
            >
            > Nor did the more compact:
            > ns4test = document.layers ?true:false;
            >[/color]

            For the sake of the exercise:

            var supportForLayer s = !!document.laye rs;

            The use of !! forces the result to be explicitly true or false and have
            the right sense.


            [...]

            --
            Rob

            Comment

            • Lee David

              #7
              Re: &quot;error on page&quot;

              > For the sake of the exercise:[color=blue]
              >
              > var supportForLayer s = !!document.laye rs;
              >
              > The use of !! forces the result to be explicitly true or false and have
              > the right sense.
              >[/color]

              I'm using <div> to enclose the text that I want to appear. I understand
              that Layers is an older and not needed technology. However, the check for
              it indicates the usage of NS which used totally different values than IE
              does. Therefore, I'm assuming I could use the above and then have code like
              this:

              if (supportForLaye rs)
              {
              turn on the various <div> based on which object incurred the mouseover or
              mouseout event using "show"
              turn off the various <div> that are not applicable to the triggering event
              using "hide"
              }

              if (supportForAll)
              {
              turn on the various <div> based on which object incurred the mouseover or
              mouseout event using "visible"
              turn off the various <div> that are not applicable to the triggering event
              using "hidden"
              }

              Would I need something for Opera, Firefox or other modzilla browsers?

              Thanks, Lee


              Comment

              • Lee David

                #8
                Re: &quot;error on page&quot;

                >[color=blue]
                > Why does it matter if its Netscape, Mozilla, FunkyBrowser or
                > myBrowserThatIM adeUpTheName? You don't browser detect, you feature detect.
                >[/color]

                Because specific browsers have specific and unique values such as Netscape's
                "show" vs. the IE "visible."
                [color=blue]
                >
                > That actually "works", it just doesn't work the way you think it would.
                >[/color]

                Could you elaborate on how it is working vs. how it would be expected to?
                [color=blue]
                >
                > if (document.layer s){
                > //use the document.layers collection
                > }
                >
                > if (document.getEl ementByID){
                > //use the getElementByID method
                > }
                >
                > if (document.all){
                > //use the document.all collection
                > }
                >
                > And all that without caring what browser it was. This is covered in the
                > groups FAQ.
                >[/color]

                I've seen 4.15 and it doesn't give very much information. For example, how
                to apply anything it says at all. Do you happen to know of a tutorial that
                does explain it and give examples?

                Thanks, Lee


                Comment

                • Lee David

                  #9
                  Re: &quot;error on page&quot;

                  > if (document.layer s){[color=blue]
                  > //use the document.layers collection
                  > }
                  >
                  > if (document.getEl ementByID){
                  > //use the getElementByID method
                  > }
                  >
                  > if (document.all){
                  > //use the document.all collection
                  > }[/color]

                  BTW, I tested each of these under NS7.2 and they all returned false.

                  Thanks, Lee


                  Comment

                  • RobG

                    #10
                    Re: &quot;error on page&quot;

                    Lee David wrote:[color=blue][color=green]
                    >>if (document.layer s){
                    >>//use the document.layers collection
                    >>}
                    >>
                    >>if (document.getEl ementByID){[/color][/color]
                    ----------------------------^

                    if ( document.getEle mentById ){

                    Case sensitivity's a bitch, eh?


                    [...]

                    --
                    Rob

                    Comment

                    • RobG

                      #11
                      Re: &quot;error on page&quot;

                      Lee David wrote:[color=blue][color=green]
                      >>For the sake of the exercise:
                      >>
                      >> var supportForLayer s = !!document.laye rs;
                      >>
                      >>The use of !! forces the result to be explicitly true or false and have
                      >>the right sense.
                      >>[/color]
                      >
                      >
                      > I'm using <div> to enclose the text that I want to appear. I understand
                      > that Layers is an older and not needed technology. However, the check for
                      > it indicates the usage of NS which used totally different values than IE
                      > does. Therefore, I'm assuming I could use the above and then have code like
                      > this:
                      >
                      > if (supportForLaye rs)
                      > {
                      > turn on the various <div> based on which object incurred the mouseover or
                      > mouseout event using "show"
                      > turn off the various <div> that are not applicable to the triggering event
                      > using "hide"
                      > }
                      >
                      > if (supportForAll)
                      > {
                      > turn on the various <div> based on which object incurred the mouseover or
                      > mouseout event using "visible"
                      > turn off the various <div> that are not applicable to the triggering event
                      > using "hidden"
                      > }[/color]

                      That's the right strategy, only test for the most common choice first -
                      Communicator 4 represents perhaps 1:1000 web surfers, so do the test
                      that will be true for the vast majority of cases first.


                      function setVisibility ( el, state ) {
                      if ( el.style ) {
                      el.style.visibi lity = ('visible'==sta te)? 'visible' : 'hidden';
                      } else if ( el.visibility ) {
                      el.visibility = ('visible'==sta te)? 'show' : 'hide';
                      } else {
                      // Some other option?
                      }
                      }


                      If the above is called with:

                      setVisibility ( elementReferenc e, 'visible' );

                      it will change the visibility property to visible or show. Anything
                      else and it will be changed to hidden or hide.

                      I don't have Communicator 4 handy so I can't test it, but it should be OK.
                      [color=blue]
                      >
                      > Would I need something for Opera, Firefox or other modzilla browsers?[/color]

                      No. The idea is to test for functionality, not browser.



                      --
                      Rob

                      Comment

                      • Lee David

                        #12
                        Re: &quot;error on page&quot;

                        I want to thank you t h i s much. It works now and at
                        last I can move on to the next (to be discovered) problem!

                        Lee


                        Comment

                        • Randy Webb

                          #13
                          Re: &quot;error on page&quot;

                          RobG said the following on 7/21/2005 11:44 PM:[color=blue]
                          > Lee David wrote:
                          >[color=green][color=darkred]
                          >>> if (document.layer s){
                          >>> //use the document.layers collection
                          >>> }
                          >>>
                          >>> if (document.getEl ementByID){[/color][/color]
                          >
                          > ----------------------------^
                          >
                          > if ( document.getEle mentById ){
                          >
                          > Case sensitivity's a bitch, eh?[/color]

                          Aint it though? I will have to smack myself on the hands for that one.

                          --
                          Randy
                          comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

                          Comment

                          Working...