这玩意儿说来简单,但真实太太太太容易报错了!!而且每一次都调好久!在这里总结一下,希望能帮助以后提升效率。
Table of Contents
1 传入多个参数时,unexpected end of input
1 传入多个参数时,unexpected end of input
这个错误多出现在我想要传入多个参数的时候
今天我做一个功能,一定要往onclick当中传两个值,但无论是我将这两个值作为两个参数传递,还是将它们拼接成一个字符串,都报同样的错误:unexpected end of input
代码如下:
js:
var a = '123';
var b = 'def';
var test_input = '"'+a+'","'+b+'"';
return '<a onclick="test('+test_input+')" ><span class="glyphicon glyphicon-edit"></span></a>';
//....
function test(a, b){
console.log('just for test');
console