概述:我将一个字符串传递给我的 javascript 函数,这里是代码:
HTML:
<span onclick='fSaveComment(/@item.model.szUserName/)'></span>
Javascript:
function fSaveComment(szUserName) {
// If I assign the following line, it strips the first and last characters,
// if I use szUserName from the function param list, it does not work!!!
//
//szUserName = '/aabbcc/';
myString = szUserName.substr(1, szUserName.length-2);
}
我究竟做错了什么?