Unknown runtime error

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

    Unknown runtime error

    I have googled for '"Internet Explorer" "Unknown runtime error"' and not
    found anything useful. I have the following (for simplicity of
    presentation here):

    <div><table><tr ><th id="foo"></th></tr></table></div>

    In my javascript I have two lines:

    var titleObj = document.getEle mentById('foo') ;
    titleObj.innerH TML = "Name is bar";

    IE6 is throwing an "Unknown runtime error" at the second line.

    What can I do about it?
  • Ugo

    #2
    Re: Unknown runtime error

    What can I do about it?

    Mmmm, do you wait for onloading the page?

    Comment

    • sheldonlg

      #3
      Re: Unknown runtime error

      Ugo wrote:
      >What can I do about it?
      >
      Mmmm, do you wait for onloading the page?
      The page is already loaded. This occurs when clicking a button on the
      page that brings up the div (making it visible, that is). This line is
      part of that javascript that presents the box.

      Comment

      • Ugo

        #4
        Re: Unknown runtime error

        >>What can I do about it?
        >Mmmm, do you wait for onloading the page?
        The page is already loaded. This occurs when clicking a button on the
        page that brings up the div (making it visible, that is). This line is
        part of that javascript that presents the box.
        You add the text when the table is hidden? and then you make it visible?
        If it is so, IE could get angry...

        Comment

        • Dr J R Stockton

          #5
          Re: Unknown runtime error

          In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
          ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
          posted:
          >
          >Thank you for your suggestion. When I made that change, all hell broke
          >loose in the rendering of the table. Investigating, I found that my
          >error had nothing to do with this problem. There was an <input
          >type="hidden"i n the table. I had failed to close that with the "
          >/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
          >to close this so I will do it for you", and rendered the table as I
          >wanted it. When I fixed the error, IE also displayed properly and
          >without a JS error.
          Restore the error, then see what W3's downloadable TIDY (used as a
          checker) and also an on-line tester say about it. I predict that you
          will then form the habit of using them.

          <FAQENTRYSectio n 2.3.
          Add something on the desirability of verifying HTML before worrying
          about what the script seems to do; particularly before posting.

          --
          (c) John Stockton, nr London, UK. ?@merlyn.demon. co.uk Turnpike v6.05 MIME.
          Web <URL:http://www.merlyn.demo n.co.uk/- FAQish topics, acronyms, & links.
          Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
          Do not Mail News to me. Before a reply, quote with ">" or "" (SonOfRFC1036)

          Comment

          • sheldonlg

            #6
            Re: Unknown runtime error

            Dr J R Stockton wrote:
            In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
            ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
            posted:
            >Thank you for your suggestion. When I made that change, all hell broke
            >loose in the rendering of the table. Investigating, I found that my
            >error had nothing to do with this problem. There was an <input
            >type="hidden"i n the table. I had failed to close that with the "
            >/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
            >to close this so I will do it for you", and rendered the table as I
            >wanted it. When I fixed the error, IE also displayed properly and
            >without a JS error.
            >
            Restore the error, then see what W3's downloadable TIDY (used as a
            checker) and also an on-line tester say about it. I predict that you
            will then form the habit of using them.
            >
            <FAQENTRYSectio n 2.3.
            Add something on the desirability of verifying HTML before worrying
            about what the script seems to do; particularly before posting.
            >
            I wish I could do that. However, if I do a "view source", all I see is
            the template. This is on an AJAX foundation using php to write the
            html. From what I have researched on the web, the validator can't be
            used with php, let alone html that is written at run time via AJAX.

            If I am wrong, them please enlighten me. I would love to check for
            errors by validations. As it is, I found this by taking my code and
            cutting and pasting into a dreamweaver window and then manually
            indenting and examining it line by line. (I just indented the print
            statements as I would have done for the tage).

            Comment

            • nobody@nowhere.net

              #7
              Re: Unknown runtime error

              On Mon, 05 May 2008 21:12:46 -0400, sheldonlg <sheldonlgwrote :
              >Dr J R Stockton wrote:
              >In comp.lang.javas cript message <-5KdnXsg_YpthYLV nZ2dnUVZ_hudnZ2 d@gigane
              >ws.com>, Mon, 5 May 2008 10:25:28, sheldonlg <sheldonlg@?.?. invalid>
              >posted:
              >>Thank you for your suggestion. When I made that change, all hell broke
              >>loose in the rendering of the table. Investigating, I found that my
              >>error had nothing to do with this problem. There was an <input
              >>type="hidden" in the table. I had failed to close that with the "
              >>/>". Apparently, Firefox was smart to enough to say "Dummy, you forgot
              >>to close this so I will do it for you", and rendered the table as I
              >>wanted it. When I fixed the error, IE also displayed properly and
              >>without a JS error.
              >>
              >Restore the error, then see what W3's downloadable TIDY (used as a
              >checker) and also an on-line tester say about it. I predict that you
              >will then form the habit of using them.
              >>
              ><FAQENTRYSecti on 2.3.
              >Add something on the desirability of verifying HTML before worrying
              >about what the script seems to do; particularly before posting.
              >>
              >
              >I wish I could do that. However, if I do a "view source", all I see is
              >the template. This is on an AJAX foundation using php to write the
              >html. From what I have researched on the web, the validator can't be
              >used with php, let alone html that is written at run time via AJAX.
              >
              >If I am wrong, them please enlighten me. I would love to check for
              >errors by validations. As it is, I found this by taking my code and
              >cutting and pasting into a dreamweaver window and then manually
              >indenting and examining it line by line. (I just indented the print
              >statements as I would have done for the tage).
              Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
              never want to use anything else. Even the obsolete 7.0 (.NET FW 1.0)
              that can be had for next to nothing does the job (or in case you don't
              care about Bill Gates' profit, just eMule it). Firefox script
              debugger next to it is like Hyundai next to BMW.

              And to see dynamically built object html, try entering into IE address
              bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
              Works with FF, too.

              NNN

              Comment

              • sheldonlg

                #8
                Re: Unknown runtime error

                nobody@nowhere. net wrote:
                And to see dynamically built object html, try entering into IE address
                bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                Works with FF, too.
                Thanks. That was [almost] great. The "almost" is because I can't cut
                and paste it. If I could do the cut and paste, I could either (a)
                format it nicely to see where I may have made a mistake or (b) put it
                into a separate html file that I could then validate and have W3C do
                that work for me. Is there a variant that would allow me to do that.

                BTW, IE changes things slightly. It removes the quotes around things
                like class="thisclas s" whereas FF doesn't. However, the formatting in
                IE is somewhat better in starting new lines.

                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: Unknown runtime error

                  nobody@nowhere. net wrote:
                  Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
                  never want to use anything else.
                  I have tried it, and I prefer the MS Script Debugger for JScript, for its
                  not being evaluation software that cannot be registered, and its comparably
                  small memory footprint. Never wanting to use anything else would be
                  nonsense anyway because MS VS.NET can only debug JScript, not JavaScript or
                  other ECMAScript implementations .
                  [...]
                  And to see dynamically built object html, try entering into IE address
                  bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                  Works with FF, too.
                  I prefer Firebug for debugging scripts in Firefox; you definitely should try
                  that.


                  PointedEars
                  --
                  Prototype.js was written by people who don't know javascript for people
                  who don't know javascript. People who don't know javascript are not
                  the best source of advice on designing systems that use javascript.
                  -- Richard Cornford, cljs, <f806at$ail$1$8 300dec7@news.de mon.co.uk>

                  Comment

                  • nobody@nowhere.net

                    #10
                    Re: Unknown runtime error

                    On Tue, 06 May 2008 21:36:14 +0200, Thomas 'PointedEars' Lahn
                    <PointedEars@we b.dewrote:
                    >nobody@nowhere .net wrote:
                    >Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
                    >never want to use anything else.
                    >
                    >I have tried it, and I prefer the MS Script Debugger for JScript, for its
                    >not being evaluation software that cannot be registered, and its comparably
                    >small memory footprint. Never wanting to use anything else would be
                    >nonsense anyway because MS VS.NET can only debug JScript, not JavaScript or
                    >other ECMAScript implementations .
                    It attaches to IE and debugs _any_ script currently running - be that
                    MS-only JScript, plain vanilla JavaScript, or even (cough!) vbscript.
                    >
                    >[...]
                    >And to see dynamically built object html, try entering into IE address
                    >bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                    >Works with FF, too.
                    >
                    >I prefer Firebug for debugging scripts in Firefox; you definitely should try
                    >that.
                    Thanks, I surely will.
                    >
                    >
                    >PointedEars

                    Comment

                    • nobody@nowhere.net

                      #11
                      Re: Unknown runtime error

                      On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlgwrote :
                      >nobody@nowhere .net wrote:
                      >
                      >And to see dynamically built object html, try entering into IE address
                      >bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                      >Works with FF, too.
                      >
                      >Thanks. That was [almost] great. The "almost" is because I can't cut
                      >and paste it. If I could do the cut and paste, I could either (a)
                      >format it nicely to see where I may have made a mistake or (b) put it
                      >into a separate html file that I could then validate and have W3C do
                      >that work for me. Is there a variant that would allow me to do that.
                      >
                      >BTW, IE changes things slightly. It removes the quotes around things
                      >like class="thisclas s" whereas FF doesn't. However, the formatting in
                      >IE is somewhat better in starting new lines.
                      OK, here's a 'greater' implementation that answers your prayer - but
                      much more heavyweight. You enter into IE address bar
                      javascript:getI t([some id], [optional true]);
                      The optional parameter doesn't work with FF due to outerHTML not being
                      a part of its object model, but setting it to false or just omitting
                      works.

                      NNN


                      <textarea id="src" rows="20" cols="150" style="display: none;"
                      comment="I am here for testing only. Delete me in
                      Production."></textarea>
                      <script language="javas cript" type="text/javascript">
                      //////////////////////////////////////////////////////////////////////////////
                      function getIt(id,outer)
                      {
                      //test function - displays ACTUAL HTML of the object corresponding
                      "id"
                      var ta=Get('src');
                      if(!ta)
                      {
                      alert('not available in this Release');
                      return;
                      }
                      var target=Get(id);
                      if(target)
                      {
                      ta.value=(outer ?target.outerHT ML:target.inner HTML);
                      ta.style.displa y='block';
                      }
                      else alert(id+' does not correspond to any object on the page');
                      }
                      </script>

                      Comment

                      • nobody@nowhere.net

                        #12
                        Re: Unknown runtime error

                        On Wed, 07 May 2008 00:28:44 GMT, "nobody@nowhere .net"
                        <mygarbage2000@ hotmail.comwrot e:
                        >On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlgwrote :
                        >
                        >>nobody@nowher e.net wrote:
                        >>
                        >>And to see dynamically built object html, try entering into IE address
                        >>bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                        >>Works with FF, too.
                        >>
                        >>Thanks. That was [almost] great. The "almost" is because I can't cut
                        >>and paste it. If I could do the cut and paste, I could either (a)
                        >>format it nicely to see where I may have made a mistake or (b) put it
                        >>into a separate html file that I could then validate and have W3C do
                        >>that work for me. Is there a variant that would allow me to do that.
                        >>
                        >>BTW, IE changes things slightly. It removes the quotes around things
                        >>like class="thisclas s" whereas FF doesn't. However, the formatting in
                        >>IE is somewhat better in starting new lines.
                        >
                        >OK, here's a 'greater' implementation that answers your prayer - but
                        >much more heavyweight. You enter into IE address bar
                        >javascript:get It([some id], [optional true]);
                        >The optional parameter doesn't work with FF due to outerHTML not being
                        >a part of its object model, but setting it to false or just omitting
                        >works.
                        >
                        >NNN
                        >
                        >
                        ><textarea id="src" rows="20" cols="150" style="display: none;"
                        >comment="I am here for testing only. Delete me in
                        >Production." ></textarea>
                        ><script language="javas cript" type="text/javascript">
                        >//////////////////////////////////////////////////////////////////////////////
                        function getIt(id,outer)
                        {
                        //test function - displays ACTUAL HTML of the object corresponding
                        >"id"
                        var ta=Get('src');
                        if(!ta)
                        > {
                        > alert('not available in this Release');
                        > return;
                        > }
                        var target=Get(id);
                        if(target)
                        > {
                        > ta.value=(outer ?target.outerHT ML:target.inner HTML);
                        > ta.style.displa y='block';
                        > }
                        else alert(id+' does not correspond to any object on the page');
                        }
                        ></script>
                        Sorry, that was copy-paste from a place that uses stub function Get to
                        getElementById (just to type less - no other benefits). Replace Get
                        with getElementById to make the code above work - or just add this:

                        function Get(someId)
                        {return getElementById( someId);}

                        ;-)

                        NNN

                        Comment

                        • sheldonlg

                          #13
                          Re: Unknown runtime error

                          nobody@nowhere. net wrote:
                          On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlgwrote :
                          >
                          >nobody@nowhere. net wrote:
                          >>
                          >>And to see dynamically built object html, try entering into IE address
                          >>bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                          >>Works with FF, too.
                          >Thanks. That was [almost] great. The "almost" is because I can't cut
                          >and paste it. If I could do the cut and paste, I could either (a)
                          >format it nicely to see where I may have made a mistake or (b) put it
                          >into a separate html file that I could then validate and have W3C do
                          >that work for me. Is there a variant that would allow me to do that.
                          >>
                          >BTW, IE changes things slightly. It removes the quotes around things
                          >like class="thisclas s" whereas FF doesn't. However, the formatting in
                          >IE is somewhat better in starting new lines.
                          >
                          OK, here's a 'greater' implementation that answers your prayer - but
                          much more heavyweight. You enter into IE address bar
                          javascript:getI t([some id], [optional true]);
                          The optional parameter doesn't work with FF due to outerHTML not being
                          a part of its object model, but setting it to false or just omitting
                          works.
                          >
                          NNN
                          >
                          >
                          <textarea id="src" rows="20" cols="150" style="display: none;"
                          comment="I am here for testing only. Delete me in
                          Production."></textarea>
                          <script language="javas cript" type="text/javascript">
                          //////////////////////////////////////////////////////////////////////////////
                          function getIt(id,outer)
                          {
                          //test function - displays ACTUAL HTML of the object corresponding
                          "id"
                          var ta=Get('src');
                          if(!ta)
                          {
                          alert('not available in this Release');
                          return;
                          }
                          var target=Get(id);
                          if(target)
                          {
                          ta.value=(outer ?target.outerHT ML:target.inner HTML);
                          ta.style.displa y='block';
                          }
                          else alert(id+' does not correspond to any object on the page');
                          }
                          </script>
                          Thanks. I am storing this one away for future use. I solved my
                          problem. It was due to an unclosed tag. So, while I don't need it now,
                          I am sure I will use it in the future.

                          Comment

                          • sheldonlg

                            #14
                            Re: Unknown runtime error

                            nobody@nowhere. net wrote:
                            On Wed, 07 May 2008 00:28:44 GMT, "nobody@nowhere .net"
                            <mygarbage2000@ hotmail.comwrot e:
                            >
                            >On Tue, 06 May 2008 07:54:25 -0400, sheldonlg <sheldonlgwrote :
                            >>
                            >>nobody@nowhere. net wrote:
                            >>>
                            >>>And to see dynamically built object html, try entering into IE address
                            >>>bar javascript:aler t(document.getE lementById('som e id').innerHTML) ;
                            >>>Works with FF, too.
                            >>Thanks. That was [almost] great. The "almost" is because I can't cut
                            >>and paste it. If I could do the cut and paste, I could either (a)
                            >>format it nicely to see where I may have made a mistake or (b) put it
                            >>into a separate html file that I could then validate and have W3C do
                            >>that work for me. Is there a variant that would allow me to do that.
                            >>>
                            >>BTW, IE changes things slightly. It removes the quotes around things
                            >>like class="thisclas s" whereas FF doesn't. However, the formatting in
                            >>IE is somewhat better in starting new lines.
                            >OK, here's a 'greater' implementation that answers your prayer - but
                            >much more heavyweight. You enter into IE address bar
                            >javascript:get It([some id], [optional true]);
                            >The optional parameter doesn't work with FF due to outerHTML not being
                            >a part of its object model, but setting it to false or just omitting
                            >works.
                            >>
                            >NNN
                            >>
                            >>
                            ><textarea id="src" rows="20" cols="150" style="display: none;"
                            >comment="I am here for testing only. Delete me in
                            >Production." ></textarea>
                            ><script language="javas cript" type="text/javascript">
                            >//////////////////////////////////////////////////////////////////////////////
                            > function getIt(id,outer)
                            > {
                            > //test function - displays ACTUAL HTML of the object corresponding
                            >"id"
                            > var ta=Get('src');
                            > if(!ta)
                            > {
                            > alert('not available in this Release');
                            > return;
                            > }
                            > var target=Get(id);
                            > if(target)
                            > {
                            > ta.value=(outer ?target.outerHT ML:target.inner HTML);
                            > ta.style.displa y='block';
                            > }
                            > else alert(id+' does not correspond to any object on the page');
                            > }
                            ></script>
                            >
                            Sorry, that was copy-paste from a place that uses stub function Get to
                            getElementById (just to type less - no other benefits). Replace Get
                            with getElementById to make the code above work - or just add this:
                            >
                            function Get(someId)
                            {return getElementById( someId);}
                            Thanks again. I am primarily a server side programmer (php) and Java,
                            c, etc. I have learned a lot of javascript over these past couple of
                            months, but I am still quite new to it. My question is that I have used
                            document.getEle mentById('src') . When is it allowable to leave off the
                            "document." prefix?

                            Comment

                            • Thomas 'PointedEars' Lahn

                              #15
                              Re: Unknown runtime error

                              nobody@nowhere. net wrote:
                              On Tue, 06 May 2008 21:36:14 +0200, Thomas 'PointedEars' Lahn
                              >nobody@nowhere. net wrote:
                              >>Ever tried to use MS VS.NET for debugging JS? Try it, and you'll
                              >>never want to use anything else.
                              >I have tried it, and I prefer the MS Script Debugger for JScript, for its
                              >not being evaluation software that cannot be registered, and its comparably
                              >small memory footprint. Never wanting to use anything else would be
                              >nonsense anyway because MS VS.NET can only debug JScript, not JavaScript or
                              >other ECMAScript implementations .
                              >
                              It attaches to IE and debugs _any_ script currently running - be that
                              MS-only JScript, plain vanilla JavaScript, or even (cough!) vbscript.
                              You obviously don't know what JScript and JavaScript are. It would appear
                              to be best to refrain from posting here until you do.




                              PointedEars
                              --
                              realism: HTML 4.01 Strict
                              evangelism: XHTML 1.0 Strict
                              madness: XHTML 1.1 as application/xhtml+xml
                              -- Bjoern Hoehrmann

                              Comment

                              Working...