PDA

View Full Version : Ext.DomQuery.selectNode()



chahat
19 Aug 2009, 10:53 PM
Hi,

i am facing an unusual problem with this function. Sometimes this function returns me with a undefined value. Am not able to guess why it does so. Could anyone please suggest me a fix.

chahat

20 Aug 2009, 2:44 AM
Hi,

i am facing an unusual problem with this function. Sometimes this function returns me with a undefined value. Am not able to guess why it does so. Could anyone please suggest me a fix.

chahat

wow, this is certainly a very vague question and problem. how about posting a reproducible example?

chahat
20 Aug 2009, 2:56 AM
Hey !!

thanks for replying..

this is the code am trying to debug ..

else if (requestType == "getStatus") {
firmware_reply = response['getStatus']; console.debug("1");
var xpath = "wwand-modem-wireless-interface-firmware/card-type/*"; console.debug("2");
isCDMA = Ext.DomQuery.selectNode(xpath,firmware_reply); console.debug(isCDMA);
if (isCDMA != undefined) { console.debug("4");

i used firebug to figure out what is happening.. and i found this output on the firebug console window..

sometimes it gives 1 -> 2 -> undefined -> 1 -> 2 -> <Text Node .> -> 4

Whereas in normal the cosole ouput should be
1 -> 2 -> <Text Node .> -> 4

i mean it will fail to execute the Ext.DomQuery.SelectNode() SOMETIMES, giving undefined value to isCDMA variable and pops up en error window, then it automatically loops back 2-3 statements before and then re-execute, this time it will assign correct value to isCDMA .

would appreciate if you could diagnose the problem.

cheers
chahat

20 Aug 2009, 2:58 AM
are those items in the DOM at the time this code is running?

20 Aug 2009, 2:59 AM
BTW, that is *not* reproducable code.

chahat
20 Aug 2009, 3:00 AM
Yeah they are in the DOM, could you brief me on why do u think the code is not reproducible? ..

20 Aug 2009, 6:46 AM
There is no markup for us to run this code on.

Are you stepping through the code with firebug?

chahat
20 Aug 2009, 9:14 PM
Yeah .. i used firebug to track which line of the code is giving an error, but then could nt find out why this function is behaving this way..