[Project_owners] Event handling

Pete Collins pete at mozdevgroup.com
Fri Jun 24 09:24:02 EDT 2005


Try:

    var contentArea = window._content;
    contentArea.addEventListener("load", test1, true);

You don't want to add the event listener to the XUL window you want to 
add it to the content area.

--pete


Michael Johnston wrote:

>i use 
>   window.addEventListener("load", init, true);
>
>On 6/24/05, Luca Minuti <lithian at tiscalinet.it> wrote:
>  
>
>>Hi,
>>
>>I'm developing an extension that every time a page is loaded must do
>>some work. The first thing to do is intercept the page load, so I
>>write this code:
>>
>>function test1()
>>{
>>  alert('test1');
>>}
>>
>>top.getBrowser().addEventListener("load", test1, false);
>>
>>But the alert will never shown. Any one can help me?
>>
>>Regards,
>>Luca.
>>
>>_______________________________________________
>>Project_owners mailing list
>>Project_owners at mozdev.org
>>http://mozdev.org/mailman/listinfo/project_owners
>>
>>    
>>
>_______________________________________________
>Project_owners mailing list
>Project_owners at mozdev.org
>http://mozdev.org/mailman/listinfo/project_owners
>
>
>  
>

-- 
Pete Collins - Founder, Mozdev Group Inc.
www.mozdevgroup.com
Mozilla Software Development Solutions
tel: 1-719-302-5811
fax: 1-719-302-5813



More information about the Project_owners mailing list