我正在尝试调试小型iMacro代码:
var go = "CODE:";
go += "VERSION BUILD=8940826 RECORDER=FX" + "\n";
go += "SET !EXTRACT_TEST_POPUP NO" + "\n";
go += "SET !ERRORIGNORE YES" + "\n";
go += "SET !TIMEOUT_PAGE 60" + "\n";
go += "SET !TIMEOUT_STEP 1" + "\n";
go += "SET !WAITTIME EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
go += "TAG POS=1 TYPE=DIV ATTR=CLASS:<SP>fastfollow-user<SP>fastfollow-userUnfollow<SP>js-ff-el&&REL:*" + "\n";
go += "WAIT SECONDS={{!WAITTIME}}" + "\n";
iimPlay(go);
我无法正确使用语法来逃避评估中的引号,有人可以帮助我吗?
我得到:SyntaxError: illegal character
及其变体。试过单引号,没有引号等......
答案 0 :(得分:1)
只需使用反斜杠和新行:
go += "SET !WAITTIME EVAL(\"var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;\")" + "\n";