How to create DOM object from html page received over XMLHttpRequest?
问题 I'm developing a chromium extension so I have cross-host permissions for XMLHttpRequests for the domains I'm asking permissions for. I have used XMLHttpRequest and got an HTML webpage (txt/html). I want to use XPath (document.evaluate) to extract relevant bits from it. Unfortunatly I'm failing to construct a DOM object from the returned string of the html. var xhr = new XMLHttpRequest(); var name = escape("Sticks N Stones Cap"); xhr.open("GET", "http://items.jellyneo.net/?go=show_items&name="