Extract single element from XMLHttpRequest

Posted by m6a-uds on Stack Overflow See other posts from Stack Overflow or by m6a-uds
Published on 2010-04-10T18:00:03Z Indexed on 2010/04/10 18:03 UTC
Read the original article Hit count: 256

Hi!

I am actually making a Sidebar Gadget, (which is AJAX-based) and I am looking for a way to extract a single element from an AJAX Request.

The only way I found yet was to do something like that:

var temp = document.createElement("div");
temp.innerHTML = HttpRequest.innerText;
document.body.appendChild(temp);
temp.innerHTML = document.getElementByID("WantedElement").innerText;

But it is pretty ugly, I would like to extract WantedElement directly from the request without adding it to the actual document...

Thank you!

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about JavaScript