Call Javscript function

Discussion in 'Javascript' started by harishdixit1@gmail.com, Nov 1, 2006.

  1. Guest

    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##########
     
    , Nov 1, 2006
    #1
    1. Advertising

  2. ASM Guest

    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>
    ....
    <script src="f_99.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
    ....
    </select>

    > 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+'();');
    }

    --
    ASM
     
    ASM, Nov 1, 2006
    #2
    1. Advertising

  3. Guest

    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......
     
    , Nov 8, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike

    NavigateUrl and Javscript

    Mike, Jul 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    407
    Martin Honnen
    Jul 17, 2004
  2. Darrel
    Replies:
    4
    Views:
    2,300
    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=
    Oct 26, 2004
  3. Benton
    Replies:
    4
    Views:
    1,155
    Mr Newbie
    Nov 26, 2005
  4. NUG-IT
    Replies:
    11
    Views:
    2,055
  5. shruds
    Replies:
    1
    Views:
    128
    Java script Dude
    Jan 20, 2006
Loading...

Share This Page