Well.. it's a private site. I even changed the event registration to try closure(even tried by defining the doNothing function first). Here is my entire test GM script, with google as the test site since everyone should get there:
// ==UserScript== // @name Div Button Event Test // @namespace http://localhost_test // @include http://google.com/* // ==/UserScript== function doSomething() { alert("starting"); var body =document.body; var div2 = document.createElement("div"); div2.setAttribute('id','div2'); div2.setAttribute('class','test_div'); div2.setAttribute('style','color:yellow;background-color:black; border:solid 1px yellow;width:30%'); var text = document.createTextNode("Some Div Button"); div2.appendChild(text); body.appendChild(document.createElement('br')); body.appendChild(div2); alert("middle"); div2.addEventListener('click', function(){ doNothing();}, false); alert("ending"); } function doNothing() { alert(event.source); } doSomething(); On Jul 23, 8:10 pm, Anthony Lieuallen <[email protected]> wrote: > On 7/23/2009 7:33 PM, [email protected] wrote: > > > Right now, I just have a test function as a stub: > > The code as you wrote it should work. Can you provide the exact, > entire, script, and the URL this happens at? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "greasemonkey-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en -~----------~----~----~----~------~----~------~--~---
