this has got me stumped, ive tried lots of different things, but cant get this to work. can anyone help? no matter what i try i cant get the click eventlistener on the link to fire. the code is in a greasemonkey script. i believe i have to use the closure method to be able to refer to the function dropit in the greasemonkey script, as it is not available to the code on the page.
dropit = function (e) {
e.preventDefault();
alert(e.target.textContent);
}
document.getElementById('newlink').addEventListener('click',
function (e){
return function (){
dropit(e);
}
}(),false);