Skip to main content

Bug Tracker

Side navigation

Ticket #4176: bug1.html


File bug1.html, 0.9 KB (added by wmleler, February 18, 2009 12:23AM UTC)

small program to reproduce the bug

<!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">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>jQuery bugs</title>
    <script type="text/javascript" src="jquery-1.3.1.js"></script>
    <script type="text/javascript">
    //<![CDATA[

    $(function () { // DOM read
      var p1 = []; // array
      var p2 = {}; // object
    
      p1[1] = 'one';
      p1[2] = 'two';
      
      p2[1] = 'one';
      p2[2] = 'two';
      
      $.each(p1, function(i, v) {
        $('#output').append('['+i+'] '+v+'<br />');
      });
      $('#output').append('<br />');
      $.each(p2, function(i, v) {
        $('#output').append('['+i+'] '+v+'<br />');
      });
    });

    //]]>
    </script>
  </head>
  <body>
    <div id="output"></div>
  </body>
</html>

Download in other formats:

Original Format