Jump to content

Sending JS via FF.au3 UDF


Vercuz
 Share

Recommended Posts

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 ;)

 

Link to comment
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
 Share

×
×
  • Create New...