0

我有以下功能

<script type="text/javascript">function downloadfunction(keyword){_gaq.push(['_trackEvent','Class1','Download',keyword])}</script>

当用户单击提交框时触发

type="submit" onClick = "downloadfunction(Where am I Wearing: A Global Tour to the Countries, Factories, and People That Make Our Clothes)

但是,当它触发时,我收到以下错误

意外的标识符

知道为什么吗?

4

1 回答 1

1

在您的第二个代码片段中,您似乎缺少第二组双引号。

您传递的字符串也需要引号。

应该更像

 type="submit" onclick = "downloadfunction('Where           
 am I Wearing: A Global Tour to the Countries,     
 factories, and People That Make Our Clothes');"
于 2013-06-23T02:27:52.613 回答