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

addEventListener don't fire events

2 views
Skip to first unread message

Marco M.

unread,
Nov 5, 2006, 7:29:18 AM11/5/06
to
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();
}

0 new messages