Solved

Run Javascript in browser

  • 14 May 2023
  • 2 replies
  • 511 views

Badge +1

Hello, Can anyone describe what is the correct way to pass variable in the run javascript action from the javascript package in A360. 

I am trying to read the filed value of an input element from browser but not able to get the output.

 


 



 

 

icon

Best answer by BeauG107806 15 May 2023, 01:42

View original

2 replies

Badge +4

Howdy. I had the same problem. I solved it by putting the function and its variables into a string, writing it to file, then calling the file using the Javascript in browser. Works a treat. Like this;

 

 

Badge +1

@BeauG107806 Thanks for the approach. I am using this way to write this snippet in the file and then call it 
function getFieldValue () {var field = document.querySelector("#id");return field.value;}

Now it is completing without any error but the output returned is also an empty value.
Same snippet I use it in the console of the browser it gives the desired output. 

Any specific form of encoding that I need to save the file, in the log to file command?

 

Reply