简体   繁体   中英

iMacros SyntaxError: missing ] after element list, line1 (Error code: -991)

Folkz - Whenever I run the below Javascript code, I keep getting error as:

SyntaxError: missing ] after element list, line1 (Error code: -991)

Not sure where I am missing the closing bracket. Kindly help. Thanks.

var _0xe78c=["CODE:","VERSION BUILD=9030808 RECORDER=FX","","SET !VAR1 "my command1"","SET !VAR2 "my command2"","EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(5)" BUTTON=0","EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" CHARS="{{!VAR1}}"","EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" KEYS="[13]" ","WAIT SECONDS = "1" ","EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" CHARS="{{!VAR2}}""];macro= _0xe78c[0];macro+= _0xe78c[1]+ _0xe78c[2];macro+= _0xe78c[3]+ _0xe78c[2];macro+= _0xe78c[4]+ _0xe78c[2];macro+= _0xe78c[5]+ _0xe78c[2];macro+= _0xe78c[6]+ _0xe78c[2];macro+= _0xe78c[7]+ _0xe78c[2];macro+= _0xe78c[8]+ _0xe78c[2];macro+= _0xe78c[9]+ _0xe78c[2];macro+= _0xe78c[7]+ _0xe78c[2]

See if This works, The error is probably due to " inside of " and that " is not multiline so we can instead use backticks for multiline strings in es6

var _0xe78c = [
  `CODE:`,
  `VERSION BUILD=9030808 RECORDER=FX`,
  ``,
  `SET !VAR1 "my command1"`,
  `SET !VAR2 "my command2"`,
  `EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(5)" BUTTON=0`,
  `EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" CHARS="{{!VAR1}}"`,
  `EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" KEYS="[13]" `,
  `WAIT SECONDS = "1" `,
  `EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" CHARS="{{!VAR2}}"`
];
macro = _0xe78c[0];
macro += _0xe78c[1] + _0xe78c[2];
macro += _0xe78c[3] + _0xe78c[2];
macro += _0xe78c[4] + _0xe78c[2];
macro += _0xe78c[5] + _0xe78c[2];
macro += _0xe78c[6] + _0xe78c[2];
macro += _0xe78c[7] + _0xe78c[2];
macro += _0xe78c[8] + _0xe78c[2];
macro += _0xe78c[9] + _0xe78c[2];
macro += _0xe78c[7] + _0xe78c[2];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM