On 1/26/10 10:26 PM, chin wrote:
my xpath is not working in firefox3.6, too
my code sample :
var XPFirst = XPathResult.FIRST_ORDERED_NODE_TYPE;
var XPList = XPathResult.ORDERED_NODE_SNAPSHOT_TYPE;
function getSnapshotItem(resText, xpath, xpType){
if (xpType==null) xpType = XPFirst;
var aDoc = document.implementation.createDocument("", "", null);
var aElem = document.createElement('DIV');
aElem.innerHTML = resText;
aDoc.appendChild(aElem);
var ret = aDoc.evaluate(xpath, aElem, null, xpType, null);
return xpType==XPFirst ? ret.singleNodeValue : ret;
}
function onSpielerComplete(XMLHttpRequest, textStatus){
if (textStatus=="success"){
var table = getSnapshotItem(XMLHttpRequest.responseText,
"//table
[...@id='villages']");
}
}
in firefox 3.5, i can get table as a table dom element
but in firefox 3.6, table == null !
Could anyone please help ?
I don't see anything obviously wrong, so I'd just install Firebug on
both 3.5 and 3.6, then either step through the code or add appropriate
console.log calls and figure out where things first differ. For example,
are resText and aDoc the same in both cases?
Brian
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to greasemonkey-us...@googlegroups.com.
To unsubscribe from this group, send email to
greasemonkey-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.