I think the reason is I should not let the function called Startup(), since
in the navigator.js, there is a function has the same name.


"Rich" <[EMAIL PROTECTED]> д���ʼ�
news:[EMAIL PROTECTED]
> I am writing a toolbar which is overlayed onto the mozilla toolbar. The
> toolbar appears in the mozilla toolbar now (it always in the mozilla
toolbar
> when mozilla is launched). Followng is the xul file for overlay and
> javascript file:
>
> // .xul
> <?xml version="1.0"?>
> <!DOCTYPE overlay>
> <overlay
> xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
>     onload="Startup()">
>     <script src="chrome://myhelper/content/myhelperOverlay.js"/>
>
>     <toolbox id="navigator-toolbox">
>         <toolbar id="myhelper-toolbox">
>             <textbox/>
>             <description value="Keyword:"/>
>             <toolbarbutton label="Test" oncommand="mytest();"/>
>             <toolbarbutton label="Delete"/>
>             <toolbarbutton label="Save"/>
>         </toolbar>
>     </toolbox>
> </overlay>
>
> // .js
> function Startup()
> {
>    alert("Startup");
> }
>
> function mytest()
> {
>     alert("mytest");
> }
>
> When mozilla is launched, alert("Startup") works; when I click the Test
> button, alert("mytest") works. But the problem is mozilla can't load page
> anymore. That means the defaul homepage can't be loaded and no matter what
I
> input in the URL bar and press Enter, mozilla doesn't response. If I
delete
> the line:
> <script src="chrome://myhelper/content/myhelperOverlay.js"/>
> from the .xul file, mozilla can load page well. So can anyone tell me what
> the problem is and how to resolve it? thank you very much.
>
>
>


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to