jQuery: query a $.get() returned string
问题 How can i query a string i get via $.get? for example, i want form google only the body html: $.get("www.google.com", function(data){ var body = $("body", data).html(); //This doesnt work }); Is it even possible? thanks 回答1: Nope, jQuery can't directly access the DOM of a page that was loaded via an XmlHttpRequest. In order to do this, you would have to use an HTML parser written in JavaScript, like the one that John Resig wrote. It's still a much harder task than you were probably expecting