View Single Post
Old 06-15-2007, 08:09 AM   PM User | #8
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,553
Thanks: 9
Thanked 480 Times in 463 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
Quote:
Originally Posted by liorean View Post
Sadly, there is to my knowledge no easy to use parser for HTML that generates an HTMLDocument object. DOMParser requires well formed XML for instance, and ...
cheer up, and turn it into valid XML!

//ff2 only
var s = new XMLSerializer();
var d = document;
var str = s.serializeToString(d);
alert(str);


instead of d, you can feed it your responseBody.


you can also create a hidden div, and set the innerHTML to the responseText.
then something like:

var newLinks=hiddenDiv.getElementsByTagName("a");

should work, as long as it is hidden, it shouldn't take that long.
but use the spankin new serializer if you can.

Last edited by rnd me; 06-15-2007 at 08:11 AM..
rnd me is offline   Reply With Quote