Hi,
I’m loading content using an XMLHttpRequest and sending it to a
div
on the fly in Greasemonkey. However, when I try to traverse through this newly loaded content and retrieve the innerHTML, jquery returns a null.
My code is as such
var xhReq = new XMLHttpRequest();
xhReq.open("GET", linksRaw, false);
xhReq.send(null);
var serverResponse = xhReq.responseText;
var tempDiv = document.createElement('div');
tempDiv.setAttribute("id", "myContainer");
tempDiv.innerHTML = serverResponse.replace(/<script(.|\\s)*?\\/script>/g, '');
var letsTry = $("div#myContainer .orgList").html();
alert (letsTry);
The alert returns a “null” when I know that .orgList link has anchor text.
Also, getElementsByClassName isn’t working either.
I’m using the latest update of Greasemonkey and FF 3.6
Thanks