Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.

addEventListener don't fire events

Yametazamwa mara 2
Ruka hadi kwenye ujumbe wa kwanza ambao haujasomwa

Marco M.

hayajasomwa,
5 Nov 2006, 07:29:1805/11/2006
kwa
I wrote the code for testing(simulate user interaction) my private
website. Firefox only displays the message "First step" and loads the
page. Probably it's due to a failure in addEventListener. I've also
tryed getBrowser().addEventListener destFrameDoc.addEventListener, ecc
ecc but it still won't work! Why?

HELP my please!!! (and of curse excuse my for my bad english)

Marco M.

var destFrameDoc;
var eventName;
var stepNum;

function findDestFrame(){
destFrameDoc = window.content.document;
}

function firstStep(){
eventName="load";
stepNum=0;
nextStep(null);
}

function nextStep(event){
switch(stepNum){
case 0://Load homepage
alert("First step");
destFrameDoc.location.href="http://marte";
break;
case 1://Click element "entrata"
alert("Second step");
var pulsante = destFrameDoc.getElementById("entrata");
pulsante.click();
break;
case 2://End of process
alert("Third step")
window.content.removeEventListener(eventName,nextStep,false);
alert("The End");
}
stepNum++;
}

function oddsbot(){
findDestFrame();
window.content.addEventListener(eventName,nextStep,false);
firstStep();
}

Ujumbe 0 mpya