biofreakz
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by biofreakz
-
-
xAddEventListener(_children[i], "click", t("works fine!"), false)
You are right it is the xAddEventListener function where the problem is. The problem is this t("works fine!"). The line calls the function t expecting it to return a function name for the handler, for the event listener. This is what you should be doing:
function t(){ alert("works fine!")}xAddEventListener(_children[i], "click", t, false)
You shouldn't call a function when assigning it to an event listener (well you can, but it is more complex). All you do is put the name of the function you wish to be called when the event is fired. So you shouldn't put t() as if you were calling the function, you should just put t.Hope this helpsAdam
-
Hello, I am a little stuck on something... I have a XML document and I want to traverse it. Here is the XML code:
<root> <item id="intro"> <caption>Introduction</caption> <link>introduction.htm</link> <icons> <inactive>images/doc.gif</inactive> <hover>images/doc_ovr.gif</hover> <highlighted>images/doc_on.gif</highlighted> </icons> </item> <folder collapsed="true" id="folder1"> <icons> <inactive>images/doc.gif</inactive> <hover>images/doc_ovr.gif</hover> <highlighted>images/doc_on.gif</highlighted> </icons> <item id="intro"> <caption>Introduction</caption> <link>introduction.htm</link> <icons> <inactive>images/doc.gif</inactive> <hover>images/doc_ovr.gif</hover> <highlighted>images/doc_on.gif</highlighted> </icons> </item> </folder> </root>
What I am stuck on is how to access all of the nodes at one level only. So for example from the ROOT node I would want the following nodes in order of how they appear in the XML document : ITEM, FOLDER. I do not want the child Nodes of the first FOLDER tag, as I would recursion to get to these. Thanks a lotAdam
setTimeout method
in JavaScript
Posted