SOLVED: Load a XML file and work with it

SOLVED: Load a XML file and work with it

Hello,

first of all i tried to goolge for it but did not find a solution. (also searched the forum for it)

here my problem: i have a XML file on my webserver (generated from php)
here is an example of its content: (store it as generated.xml)

<?xml version="1.0" encoding="UTF-8"?>
<xml>
<gallery>
<title>sampleGallery</title>
<folderName>sampleGallery</folderName>
<paging>true</paging>
<pageLimit>100</pageLimit>
<pictures>
<picture>
<fileName>fileName</fileName>
<title>title</title>
<owner>owner</owner>
<exclude>false</exclude>
<allowOriginalDownload>false</allowOriginalDownload>
</picture>
</pictures>
</gallery>
</xml>
then i created an html file which includes jquery-1.8.3.min.js (should be the latest version)
(store it as xmlTest.html in the same folder as generated.xml
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3.    <head>
  4.       <title>HTML 4.01 Strict</title>
  5.       <script language="JavaScript" type="text/JavaScript" src="jquery-1.8.3.min.js"></script> 
  6.       <script>
  7.         $(document).ready(function(){
  8. $.ajax({
  9. //type: "GET",
  10. type: "POST",
  11. url: "http://localhost/dev/FolderGallery/generated.xml",
  12. //url: "generated.xml",
  13. contentType: "application/xml; charset=utf-8",
  14. dataType: "xml",
  15. success: function(xml) {
  16. alert('success');
  17. // works in FireFox, not called in Chrome?
  18. alert('folderName = '+$(xml).find('folderName').text());
  19. // go through all images
  20. /*
  21. $(xml).find('pictures').each( function() {
  22. var title = $(this).find('title').text();
  23. alert(title);
  24. }
  25. */
  26. },
  27. complete: function(httpRequest, textStatus, errorThrown) { 
  28.                alert("COMPLETE:\nhttpRequest="+httpRequest+"\nstatus=" + textStatus + "\nerror=" + errorThrown);
  29. },
  30. error: function(httpRequest, textStatus, errorThrown) { 
  31.                alert("ERROR:\nstatus=" + textStatus + "\nerror=" + errorThrown);
  32. },
  33. });
  34. });
  35.       </script> 
  36.    </head>
  37.    <body>
  38.     <h1></h1>
  39.    </body>
  40. </html>

my problem is:
this is only working if i have a local copy of generated.xml in the same folder as the xmlTest.hml
but finally the generated.xml will be on the same webserver as the xmlTest.html (which will be called differend then and included in php ;) )

further: firefox fires the success function, whereat chrome doesnt; it tells me only complete/error!

note: i tried both, GET and POST (as you can see in the code)

whats my failure?
thanks in advance
bullet