If you know about jQuery, could you have a look at this for me please?
That function is called by $(document).ready. I have confirmed that it has been called (because of alerts). And it seems to be recieving the xml document properly as well. Unfortunately, from this line:
Nothing seems to be happening (as in... "alert" fails). The XML file looks a bit like this:
The idea is I want it to get the HTML from inside the <component> tags and display it within <div id="component"></div>.
If anyone could help, I'd really appreciate it.
| Code: |
| function doAll()
{ var data = getQueryString(); // Gets anything on the url, I haven't posted this function here because I know it works var urlToUse = "process.php"; if (data['name'] != null) { urlToUse = urlToUse + "?name=" + data['name']; if (data['file'] != null) { urlToUse = urlToUse + "&file=" + data['file']; } } // The function convertToString is again written elsewhere. It works fine. $.ajax({ type: "POST", dataType: "xml", url: urlToUse, data: convertToString(data), success: function(xml) { var comp; $('component', xml).each(function(id) { comp = $('component', xml).get(id); alert (comp); $('#component').text(comp); }); } }); } |
That function is called by $(document).ready. I have confirmed that it has been called (because of alerts). And it seems to be recieving the xml document properly as well. Unfortunately, from this line:
| Code: |
| $('component', xml).each(function(id) { |
Nothing seems to be happening (as in... "alert" fails). The XML file looks a bit like this:
| Code: |
| <proc>
<component> (some html) </component> (some more values that I'll be using later on) </proc> |
The idea is I want it to get the HTML from inside the <component> tags and display it within <div id="component"></div>.
If anyone could help, I'd really appreciate it.
