Skip to content

Commit 38d86c5

Browse files
committed
Fix javascript compatibility issue on send command
1 parent 5e81939 commit 38d86c5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

esp3d/data/printer.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,8 @@ var XYfeedrate=$XY_FEEDRATE$;
385385
var Zfeedrate=$Z_FEEDRATE$;
386386
var Efeedrate=$E_FEEDRATE$;
387387
388-
function Sendcommand(commandtxt, showresult=false){
388+
function Sendcommand(commandtxt, showresult){
389+
if (typeof showresult === 'undefined')showresult=false
389390
var xmlhttp = new XMLHttpRequest();
390391
var url = "/command?plain="+encodeURIComponent(commandtxt);
391392
if (!showresult)url = "/command_silent?plain="+encodeURIComponent(commandtxt);
@@ -407,7 +408,8 @@ ms += new Date().getTime();
407408
while (new Date() < ms){}
408409
}
409410
410-
function SendJogcommand( cmd, feedrate, extra=""){
411+
function SendJogcommand( cmd, feedrate, extra){
412+
if (typeof extra === 'undefined')extra=""
411413
if (extra != ""){
412414
Sendcommand(extra);
413415
delay(100);

0 commit comments

Comments
 (0)