You are not logged in.

#1 2024-03-20 12:19:18

Rahul
Member
Registered: 2019-11-27
Posts: 39

Unable to use javascript on gcode boxes

Hello Shahin,
I have a nanodlp setup with klipper for motion controller. I have tried using javascript code on the gcode boxes for get URL code (as shown on the docs pages) and that doesnot seem to work. Simple things seem to work though.

Sample Code that works
[JS]
output = "test_output"
[/JS]

Sample Code that fails. There is no output returned.
[JS]
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "http://localhost/term-io", false);
xmlHttp.send(null);
output = xmlHttp.responseText;
[/JS]

Also, is there a way to send [[Pause]] like commands from external script call. Currently, the return from external script call is assumed to be gcode command, I guess. your comments.

many thanks!
Rahul

Last edited by Rahul (2024-03-20 14:18:46)

Offline

#2 2024-03-29 15:47:31

Shahin
Administrator
Registered: 2016-02-17
Posts: 3,541

Re: Unable to use javascript on gcode boxes

XMLHttpRequest not supported. Activity dashboard report the exact issue.
You can use [[NetReturn]] keyword.

Offline

Board footer

Powered by FluxBB