[dokuwiki] Re: addEvent javascript question

  • From: "Martin Tschofen" <martin.tschofen@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 24 May 2006 07:33:02 -0500

In case somebody else runs into this.
The only way I got it to work was by avoiding parameters in addEvent.

   addInitEvent(installDDs); //installDDs adds events to dom tree items

   function installDDs(){
      //find the item to attach the event to
      addEvent(thisPopup, 'change', linkToPage); //assign event to
found dom item
   }

This turns out to be no problem as the event is directly attached to
the dom object. Thus from within the event refering to 'this' object
allows access to the items methods and variables.

function linkToPage() {
 alert(this.value); //show the assigned value of this drop down.
}

Hope this helps somebody else...martin
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: