javascript - jquery ajax parse response text -
OK, it really disappoints me because I have done it a hundred times earlier, and this time it is not working Has been doing. So I know that I am doing something wrong, I can not understand it.
I am using jQuery. I do not want to use .load because it always replaces the element's children which I am loading content.
It's mine. Request:
$ (document) .ready (function () {$ .get ('info.html', {}, function (html) {// debug code console.log ( $ (Html). Find ('ul') .HTML ()); // and debug code}};});
File 'info.html' with a proper functionality There is a standard xhtml file, and the only thing in the body is a series of ul that i need to access. For some reason, the function is giving me a zero value.
In firebug, the GET request is appropriate The answer is showing the text and when I
console.log (html);
instead of the current console. I get full information html output, just like I expected .
Any ideas?
You can not drag a complete XHTML document You can handle only the tag inside the & lt; body & gt;
of HTML code, it is frustrating. From Info.html your & lt; body & gt;
Is not within the tag and try it again.
There are other possible ways around - the check given below is "Stackwise Flow Related Items" based on this reaction.
From the document: ()
"HTML strings can not contain elements that are invalid within a div, such as HTML, head, body Or title element. "
Comments
Post a Comment