JavaScript Error being caused by body onload

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • h2ojunkie
    New Member
    • Jul 2004
    • 21

    JavaScript Error being caused by body onload

    I'm having a problem on just certian pages where I'm getting a javascript error of "null is null or not an object" referencing the body tag.

    HTML Code:
    <body onload="if (is_ie || is_moz) { fetch_object('currentPost').scrollIntoView(!is_moz); }">
    It only appears on pages where the url string is to a specific post. For example, when clicking the "go to last post" button or "go to first new post" buttons.


    Anyone have any suggestions?


    example url: http://www.thumpertalk.com/forum/sho...wpost&t=228006
  • weirdpixels
    Senior Member
    • Aug 2003
    • 401
    • 3.0.7

    #2
    I don't have any suggestions, but I also get this same error
    http://www.weirdpixels.com/images/buttons/button.gif

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      Where are you trying to define that? Showthread as well as other pages have an $onload varible defined, ontop of that body is already defined in every template where it needs to be.

      Comment

      • weirdpixels
        Senior Member
        • Aug 2003
        • 401
        • 3.0.7

        #4
        At the moment I get the null is null javascript error, when you post a new post or when clicking on the go to last post button. So it basically happens when you have a url that looks something like this showthread.php?p=6296#post6296

        If I double click on the error, it says there is an error on line 423, so looking at my page source I see

        HTML Code:
        <body onload="if (is_ie || is_moz) { fetch_object('currentPost').scrollIntoView(!is_moz); }">
        Is located at line 423, if I search for this code in my templates, nothing comes up.

        This error does not happen if I use the vbulletin default style, so it's not like its getting this from any of the files.

        I have
        HTML Code:
        <body onload="$onload">
        In the Showthread template for the style that this is having this error.
        This javascript error does not seem to affect firefox.

        Any ideas of what is causing this?
        http://www.weirdpixels.com/images/buttons/button.gif

        Comment

        • h2ojunkie
          New Member
          • Jul 2004
          • 21

          #5
          Originally posted by Zachery
          Where are you trying to define that? Showthread as well as other pages have an $onload varible defined, ontop of that body is already defined in every template where it needs to be.
          PHP Code:
           <body onload="$onload"
          Is also what is in my template for the page that is having the error, and the generated html output by that template is resulting in:

          HTML Code:
          <body onload="if (is_ie || is_moz) { fetch_object('currentPost').scrollIntoView(!is_moz); }">
          Which is the cause of the javascript error.

          Comment

          • h2ojunkie
            New Member
            • Jul 2004
            • 21

            #6
            bump

            Comment

            • Zachery
              Former vBulletin Support
              • Jul 2002
              • 59097

              #7
              We've identified the problem, its the custom java script you are trying to add, to fix it you should try asking for help at vBulletin.org

              Comment

              • h2ojunkie
                New Member
                • Jul 2004
                • 21

                #8
                Will do.

                Thanks.

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...