I've got some jQuery code that seems to work fine in Safari and
Firefox both under OSX and Windows. But I've been beating my head
against the wall trying to get the same code running under IE7.  I
must be missing something :-( I'm a novice at javascript and jQuery.
The following is a much abbreviated and simplified version. Under IE,
the alert function in the loop below comes up with "Color: " each time
as if the "find" seems to be returning null. Does anyone have a
suggestion?

The same code can be found online at:

http://batbox.org/bh.html


Thanks,

Jim Buzbee

...

<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<script type="text/javascript">

jQuery(function()
{
   var xml = jQuery( '<span>  <item><color>White</color></item>' +
                                '             <item><color>Black</
color></item>' +
                               '</span>'  );

   $(xml).find("item").each(function()
   {
      alert('Color: ' + $(this).find("color").text() );
   });
});

</script>

...



Reply via email to