我在javascript的html页面中收到错误 我试图在函数中传递字符串变量 PFB代码
document.write('<input type = "submit" value = "Details" class = "myButton" onClick = "dealerDetailsService(\''+orderDate+'\,\''+dealerCode+'\')"></input>');
给出错误
Expected ')'
答案 0 :(得分:4)
在第一个参数之后你忘记了'
:
document.write('<input type="submit" value="Details"
class="myButton"
onClick="dealerDetailsService(\''+orderDate+'\',\''+dealerCode+'\')" />');
^ here