Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.61 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. JQuery Ajax won't display results in Chrome
  2. <html>
  3. <head>
  4. <script src="http://code.jquery.com/jquery-latest.js"></script>
  5. <script>
  6. $(document).ready(function()
  7. {
  8.     $.ajax({
  9.         type: "GET",
  10.         url: "test.xml",
  11.         dataType: "xml",
  12.         success: parseXml
  13.     });
  14. });
  15.  
  16. function parseXml(xml)
  17. {
  18.     $(xml).find("test").each(function()
  19.     {
  20.         $("#test").append("<tr><td>" + $(this).find("name").text()+"</td><td>" + $(this).find("phone").text()+"</td></tr>");
  21.         $('#test').trigger('create');
  22.     });
  23. }
  24.  
  25. </script>
  26. </head>
  27. <body>
  28.  
  29. <table id="test" border="1"></table>
  30. </body>
  31. </html>