参数列表后面的SyntaxError:missing) [英] SyntaxError: missing ) after argument list

查看:123
本文介绍了参数列表后面的SyntaxError:missing)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到语法错误:

SyntaxError: missing ) after argument list

从这个jQuery代码:

From this jQuery code:

$('#contentData').append(
  "<div class='media'><div class='media-body'><h4 class='media-heading'>" + 
  v.Name + "</h4><p>" + v.Description + "</p><a class='btn' href='" + 
  type + "'  onclick="(canLaunch('" + v.LibraryItemId + " '))">
  View &raquo;
  </a></div></div>")

这种Javascript语法错误会产生什么样的错误?

What kinds of mistakes produce this Javascript Syntax error?

推荐答案

你在onclick处理程序中有一个未转义的,用 \转义它

You had a unescaped " in the onclick handler, escape it with \"

$('#contentData').append("<div class='media'><div class='media-body'><h4 class='media-heading'>" + v.Name + "</h4><p>" + v.Description + "</p><a class='btn' href='" + type + "'  onclick=\"(canLaunch('" + v.LibraryItemId + " '))\">View &raquo;</a></div></div>")

这篇关于参数列表后面的SyntaxError:missing)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆