I’m cheating on this now, and I don’t know what I am doing wrong. The script, as it should, I use swfupload to upload files with the progress bar through a web service. the web service needs to return the name of the generated thumbnail. This all goes well, and although I prefer to get the returned data in json (may change it later in the swfupload js files), by default the xml data is fine too.
So, when the download is complete, webservice returns the following xml as expected (note: I removed the namespace in the webservice):
<?xml version="1.0" encoding="utf-8"?> <string>myfile.jpg</string>
Now I want to analyze this result using jquery and thought the following:
var xml = response; alert($(xml).find("string").text());
But I can not get the string value. I tried many combinations (.html () ,. innerhtml (), response.find ("string"). Text () but nothing works. This is my first time when you try to parse xml via jquery, so maybe , I “Doing something fundamentally wrong.” The “answer” is populated with xml.
Hope someone can help me. Thank you for your time.
Regards, Mark
source share