简体   繁体   中英

SyntaxError: missing ) after argument list in cart.js

I'm getting

SyntaxError: missing ) after argument list | in cart.js file

// Purchase button.
        add('<button onclick="yaCounter44762137.reachGoal('zakaz'); return true;" class="btn btn-primary cart-purchase-button" type="button"></button>')

If you escape the single quotes like this:

add('<button onclick="yaCounter44762137.reachGoal(\'zakaz\'); return true;" class="btn btn-primary cart-purchase-button" type="button"></button>');

It'll work.

Or you can change the zakaz in double quotes. It would make things a lot easier to do.

add('<button onclick="yaCounter44762137.reachGoal("zakaz"); return true;" class="btn btn-primary cart-purchase-button" type="button"></button>');

Or you can even use one double quote and put everything else in a single quote:

add("<button onclick=yaCounter44762137.reachGoal('zakaz'); return true;' class='btn btn-primary cart-purchase-button' type='button'></button>");

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