Bug Tracker

Opened 12 years ago

Closed 11 years ago

#2270 closed bug (duplicate)

main demo broken in firefox 2

Reported by: jsprenkl Owned by:
Priority: major Milestone: 1.2.3
Component: core Version: 1.2.2
Keywords: Cc:
Blocked by: Blocking:

Description

The demo on this page http://docs.jquery.com/UI/Tabs fails in Firefox 2.0 Shows a regular unordered list. The error console shows no problems except the call to urchin tracker. I do get a lot of warnings about jquery though

Warning: reference to undefined property elem.nodeType Source File: http://code.jquery.com/jquery-latest.js Line: 1020

Change History (4)

comment:1 Changed 12 years ago by sampablokupe

I'm experiencing a very similar problem.

I'm using:
Macbook 2.13GHz, 2GB RAM
Windows Vista Home Premium via Leopard Boot Camp
Firefox 2.0.0.12
jquery-1.2.3.min.js
jQuery innerfade III
XAMPP (basic package) version 1.6.6a

I've written an XHTML document that I'm serving to Firefox via XAMPP. The document validates as XHTML 1.0 strict. When I open the page in Firefox (at http://localhost/myproject/index.html via XAMPP), the Firefox error console gives me the following error, many times over:

Warning: reference to undefined property elem.nodeType
Source File: http://localhost/myproject/javascript/jquery-1.2.3.min.js
Line: 24

The XHTML code looks like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Title</title>
      <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
      <meta name="description" content="foo"/>
      <meta name="keywords" content="bar"/>
      <link rel="stylesheet" type="text/css" href="default.css"/>
      <link rel="shortcut icon" href="favicon.png" type="image/png"/>
      <script src="javascript/jquery-1.2.3.min.js" type="text/javascript"></script>
      <script type="text/javascript">jQuery.noConflict();</script>
      <script src="javascript/jquery.innerfade.js" type="text/javascript"></script>
    </head>
    <body>
      <script type="text/javascript">
        jQuery(document).ready(
	  function(){
            jQuery('ul#imgSwap').innerfade({
              speed: 1000,
              timeout: 4500,
              type: 'sequence',
              containerheight: '220px'
              });
        });
      </script>
      <div id="container">
        <img src="images/banner.jpg" alt="Banner image"/>
        <div id="mainMenuWrapper">
          <ul class="mainMenu">
            <li class="mainMenu" id="mainMenu1"><a href="index.php">Home</a></li>
            <li class="mainMenu" id="mainMenu2"><a href="page2.php">Page2</a></li>
            <li class="mainMenu" id="mainMenu3"><a href="page3.php">Page3</a></li>
          </ul>
        </div>
        <div id="contentLeft">
          <ul id="imgSwap" style="list-style-type: none; margin: 0 20px 20px 0; display: block">
            <li>
              <a href="buy.php"><img src="images/cover_uk_small.jpg" alt="Photo of book cover,
               UK edition" /></a>
            </li>
            <li>
              <a href="buy.php"><img src="images/cover_us_small.jpg" alt="Photo of book cover,
               US edition" /></a>
            </li>					
          </ul>
        </div>
        <div id="contentRight">
          <h2>Content</h2>
          <p>Foo bar etc</p>
        </div>
        <div id="footer">
          <div class="footerText" id="siteAuthor">
            Web site by <a href="http://www.me.com">me</a>
          </div>
          <div class="footerText" id="validators">
            <a href="http://validator.w3.org/check?uri=referer">XHTML 1.0 Strict</a>
            <a href="http://validator.w3.org/check?uri=referer/default.css">CSS</a>
          </div>
        </div>
      </div>
      <script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'  
        type='text/javascript'%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
        var pageTracker = _gat._getTracker("UA-1867618-3");
        pageTracker._initData();
        pageTracker._trackPageview();
      </script>
    </body>
</html>

comment:2 Changed 12 years ago by sampablokupe

I've just tried the exact same setup but with jquery-1.2.3.js in place of jquery-1.2.3.min.js .

The result is identical, except that the error console messages point to line 1045 instead.

I'd appreciate any suggestions about how to resolve this!
Thanks,
Sam

comment:3 Changed 12 years ago by davidserduke

First of all note this is a "warning" and not an "error".

Unfortunately, the answer to fix it is likely to set "javascript.options.strict" to false. In firefox, the user has the option to set it to true. From what I've seen it is always false by default but some developers turn it on.

The theory of this setting is it will help you catch some errors in your code by throwing warnings for common mistakes people make. In practice, sometimes the warnings are misleading, making people think there is an error when really it isn't. This has been brought up a few times. If you are interested in reading more details about this issue (like why we currently have no plans to fix it) check the below ticket and read the thread linked in the comments.

http://dev.jquery.com/ticket/2079

comment:4 Changed 11 years ago by davidserduke

Resolution: duplicate
Status: newclosed

Duplicate of #2079 it appears. If you have another test case you'd like to submit to show the problem feel free to reopen the ticket.

Note: See TracTickets for help on using tickets.