Jump to content
Sign in to follow this  
Vercuz

Sending JS via FF.au3 UDF

Recommended Posts

Vercuz

Hello. 

I need to execute this script

var i;
var select = document.getElementById("test");
for(i=1;i<select.options.length;i++) {
  select.options[i].selected=false;
}

Using autoit with FF.au3.

I tried using it like - 

_FFCmd('var i;var select = document.getElementById("test");for(i=1;i<select.options.length;i++) { select.options[i].selected=false;}');

But it doesn't work.

_FFConnect: AutoIt: 3.3.14.1
_FFConnect: FF.au3: 0.6.0.1b-15
_FFConnect: IP: 127.0.0.1
_FFConnect: Port:   4242
_FFConnect: Delay:  2ms
_FFConnect: Socket:     696
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.3; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
__FFSend: try{var i;var select = document.getElementById("test");for(i=1;i<select.options.length;i++) {  select.options[i].selected=false;}}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err

If I paste it manually into firebug it works. I need to reset two selects inside a form on page but_FFFormReset() sometimes doesnt work for me.

Thank you in advance and best regards ;)

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • JuanFelipe
      By JuanFelipe
      Cambiar a español Hello friends, I need help with a problem I have, I want to know if there is any way to update a GUI already running, that is I have a GUI of a certain size and with a button I would like to enlarge it:
      example: $ form1 = GUICreate ("", 200,100,0,0)   When you press the button, the gui increases its size, and actuates the new size.
    • BogdanNicolescu
      By BogdanNicolescu
      While 1 / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / WEnd OR:

       
      HotKeySet("{ESC}", "Terminate") While 1 MouseClick("Right",674,422) MouseClick("Left",673,447) Sleep(2000) / / / A whole bunch of codes found in help and here: https://www.autoitscript.com/autoit3/docs/ / / / MouseClick("Left",675,339) SLeep(3000) WEnd Func Terminate()     Exit 0 EndFunc  
      Sorry if i should't let this here to be found by newbies like me -.-'
    • santoshM
      By santoshM
      Dear friends i am facing a problem , i have created a window in autoit some time it is moving with the mouse curser even if iam not clicking the window 
    • sumanth1980
      By sumanth1980
      Here i am wrote a simple lines to install basic applications but when i clicked on one application/program to install it was working fine but when i cancel the program in the middle to install another program it was not working. I am not an expert in this but i want a solution for this ... Can any one help me on this....
      ORG-1.au3
    • PleaseHelpMEIWillLoveyou
      By PleaseHelpMEIWillLoveyou
      Is there a way to use a custom terminal or something from my pc and run a script on another pc.
      please let me know if its possible
      (not for anything bad just for a project im working on)
×