Jump to content

biofreakz

Members
  • Posts

    3
  • Joined

  • Last visited

biofreakz's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. The reason for why you have to take the form " + x + "," + y + " is simple. The setTimeout function stores the first parameter as a string, the x and y are variables. So when the function moveText function is called, it is called anonymously, so the variables x and y are not going to be available to it. So you have to give it values for the parameters instead of variable references.Hope this helps!
  2. 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
  3. 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
×
×
  • Create New...