我的JavaScript是这样的:
var contentItem = '<a onclick="ga('send', 'event', 'find-a-doctor', 'appointment', 'Appointment from Home');" class="waves-effect waves-dark">Make an Appointment</a>';
上面的引号似乎是错误的。我该如何解决?
最佳答案
您可以使用``
(反引号或反引号),例如:
var contentItem = `<a onclick="ga('send', 'event', 'find-a-doctor', 'appointment', 'Appointment from Home');" class="waves-effect waves-dark">Make an Appointment</a>`;
关于javascript - 如何修复JavaScript中的嵌套引号?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58093742/