title: jQuery .find() doesn't return data in IE but does in Firefox and Chrome
body: <p>I helped a friend out by doing a little web work for him. Part of what he needed was an easy way to change a couple pieces of text on his site. Rather than having him edit the HTML I decided to provide an XML file with the messages in it and I used jQuery to pull them out of the file and insert them into the page.</p>
  
  <p>It works great... In Firefox and Chrome, not so great in IE7. I was hoping one of you could tell me why. I did a fair but of googling but couldn't find what I'm looking for.</p>
  
  <p>Here's the XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;messages&gt;
    &lt;message type="HeaderMessage"&gt;
      This message is put up in the header area.
    &lt;/message&gt;
    &lt;message type="FooterMessage"&gt;
      This message is put in the lower left cell.
    &lt;/message&gt;
  &lt;/messages&gt;
  </code></pre>
  
  <p>And here's my jQuery call:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function() {
      $.get('messages.xml', function(d) {
        //I have confirmed that it gets to here in IE
        //and it has the xml loaded.
        //alert(d); gives me a message box with the xml text in it
        //alert($(d).find('message')); gives me "[object Object]"
        //alert($(d).find('message')[0]); gives me "undefined"
        //alert($(d).find('message').Length); gives me "undefined"
        $(d).find('message').each(function() {
          //But it never gets to here in IE
          var $msg = $(this);
          var type = $msg.attr("type");
          var message = $msg.text();
          switch (type) {
          case "HeaderMessage":
            $("#HeaderMessageDiv").html(message);
            break;
          case "FooterMessage":
            $("#footermessagecell").html(message);
            break;
            default:
          }
        });
      });
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>Is there something I need to do differently in IE? Based on the message box with [object Object] I'm assumed that .find was working in IE but since I can't index into the array with [0] or check it's Length I'm guessing that means .find isn't returning any results.  Any reason why that would work perfectly in Firefox and Chrome but fail in IE?</p>
  
  <p>I'm a total newbie with jQuery so I hope I haven't just done something stupid. That code above was scraped out of a forum and modified to suit my needs.  Since jQuery is cross-platform I figured I wouldn't have to deal with this mess.</p>
  
  <p>Edit: I've found that if I load the page in Visual Studio 2008 and run it then it will work in IE.  So it turns out it always works when run through the development web server.  Now I'm thinking IE just doesn't like doing .find in XML loaded off of my local drive so maybe when this is on an actual web server it will work OK.</p>
  
  <p>I have confirmed that it works fine when browsed from a web server.  Must be a peculiarity with IE.  I'm guessing it's because the web server sets the mime type for the xml data file transfer and without that IE doesn't parse the xml correctly.</p>