Call Javscript function

H

harishdixit1

Hello friends i developed a tollbar for Firefox browser. Now This
toolbar contains a menu item. A web page will be opened by the user of
the Toolbar. This Web page source code has included many .JS fiels in
it. These JS files defined various functions , Now i want to call these
functions from my toolbar menu command. How can i do that? I know
function name which i have to call.

I tried to call function directly by its name but it is giving error
that this function is not exist?

How should i call that function.

I got success to implement same functionality for IE by using
IHTMLWindow2 interface method
execScript which can execute javascript code.

Harish Kumar Dixit##########
 
A

ASM

(e-mail address removed) a écrit :
Hello friends i developed a tollbar for Firefox browser. Now This
toolbar contains a menu item. A web page will be opened by the user of
the Toolbar. This Web page source code has included many .JS fiels in
it.

do you mean you have a page this way :

<script src="f_01.js" type="script/javascript"></script>
<script src="f_02.js" type="script/javascript"></script>
....
These JS files defined various functions , Now i want to call these
functions from my toolbar menu command. How can i do that? I know
function name which i have to call.

<select name="chooser1" onchange="choose(this)">
<option>functions
<option value="pop">popup
....
I tried to call function directly by its name but it is giving error
that this function is not exist?

certainly (or an error in preloading in your includes ?)
How should i call that function.

function choose(selct) {
var k = selct.selectedIndex;
if(k==0) alert('chose another item')
else
eval(selct[k].value+'();');
}
 
H

harishdixit1

u r correct my web page has something like this
<script src="f_01.js" type="script/javascript"></script>

Now f_01.js file has some functions defined. I want ot call that
function ffrom my firefox toolbar.
My toolbar has its own .JS file and i want to call it from that file.

i dont have any select type of thing......
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top