These might be of interest for debugging in IE:

http://www.fiddlertool.com/fiddler/
http://www.getfirebug.com/lite.html
http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en

Also, in IE, set these:

tools > internet options > advanced:
- Disable Script Debugging > unchecked
- Display a notification about every script error > checked

If the http response is working and looks good, and IE still shows no sign of a js error, then a js selector might not be working the way you expect it to. That kind of fail will fail silently. I've never tried to use jquery selectors against XML that's not in the DOM, so am not sure about how (or if) that works (it looks like that's what you're doing below with selectors on the xmlDataSet context).

I also noticed that some vars are not declared using keyword var before being used, not sure it that might matter in this case (ie var resultSetLength = 0; var strToAppend = '';).

Someone else also pointed out that language="javascript" vs type="text/javascript" might make a difference (I always use the latter).

At minimum, you can use firebug lite to add console logging entries to get some insight on where the script is failing, or fall back to the old"stick in a bunch of alerts" approach and see how far things get.

- Jack


meddling wrote:
I'm very interested in this as well.  I'm running into the same
problem with my mockup project.  Runs fine in Mozilla (like most
things :)), but IE fails silently.  I really wish I had some sort of
Firebug for IE, so I could at least see if the HTTP requests were
being sent (and if they were giving proper responses).  I'd assume the
server response is valid -- since the browser shouldn't make much of a
difference there -- but if it's a Javascript issue, why doesn't IE
report an error?

My head has been hurting on this one for the past week!

Someone enlighten us, please! :)

Jonathon

On Sep 20, 3:53 pm, m2web <[EMAIL PROTECTED]> wrote:
When loading the following into IE 6. I get no error. Nothing. Any
help is appreciated.

<html>
  <head>
    <title>Parse XML with JQuery</title>
    <script language="javascript" src="jquery-1.2.1.js"></script>
    <script language="javascript">

      $(function() {
        $.ajax({
          type: "POST",
          url: "books.xml",
          dataType: "xml",
          success: function(xmlData)
          {
            xmlDataSet = xmlData;
            buildHTMLFromXML();
          }
        });
      });

      function buildHTMLFromXML()
      {
      resultSetLength = $("book",xmlDataSet).length;

      strToAppend = "<strong>There are a total of " + resultSetLength
+ " books</strong>.<br />";
      strToAppend += "------------------------<br />";
      $("title",xmlDataSet).each(function(i) {
        strToAppend += "<strong>" + $(this).text() + "</strong><br />";

        strToAppend += "by " + $("author:eq(" + parseInt(i) +
")",xmlDataSet).text() + "<br />";
        strToAppend += "Publisher: " + $("publisher:eq(" + parseInt(i)
+ ")",xmlDataSet).text() + "<br />";
        strToAppend += "ISBN-10: " + $("isbn:eq(" + parseInt(i) +
")",xmlDataSet).text();
        strToAppend += "<br />";
        strToAppend += "<br/>***********";
        strToAppend += "<br />";
      });
      /*
      Populate our DIV with the HTML String
      */
      $("#widget").html(strToAppend);
      }
    </script>
  </head>
<body>
        <div id="widget" style="float:left"></div>
</body>
</html>



Reply via email to