Execute JavaScript code in user browser. The code is run in the browser's JS global scope. :param str code_: JavaScript code :param args: Local variables passed to js code. Variables need to be JSON-serializable. Example:: run_js('console.log(a + b)', a=1, b=2)
(code_, **args)
| 338 | |
| 339 | |
| 340 | def run_js(code_, **args): |
| 341 | """Execute JavaScript code in user browser. |
| 342 | |
| 343 | The code is run in the browser's JS global scope. |
| 344 | |
| 345 | :param str code_: JavaScript code |
| 346 | :param args: Local variables passed to js code. Variables need to be JSON-serializable. |
| 347 | |
| 348 | Example:: |
| 349 | |
| 350 | run_js('console.log(a + b)', a=1, b=2) |
| 351 | |
| 352 | """ |
| 353 | from ..io_ctrl import send_msg |
| 354 | send_msg('run_script', spec=dict(code=code_, args=args)) |
| 355 | |
| 356 | |
| 357 | @chose_impl |
no test coverage detected
searching dependent graphs…