alert(name);
要多坯料在變量(未捕獲的SyntaxError:意外令牌非法的)
輸出應該「pikkertonnode_1334187978」
的第二'是遠離文本的末尾。
這是我的代碼:
var name;
var namehelp;
// For individually tab
function refresher() {
var url = 'output.php?string=' + choice[0].innerText;
var split = url.split("[new]");
var series = "[" ;
for (var i = 1; i < split.length; i++)
{
namehelp = split[i];
var splithelp = namehelp.split(")");
namehelp = splithelp[1];
alert(namehelp);
name = "'" + namehelp + "'";
alert(name);
series = series + "{ name : " + name + " , data : data[" + (i-1) + "] }," ;
}
VAR URL是這樣的:
http://172.23.133.61:60080/pages/select-multiple-start/output.php?string=[new]frequency%20(Monitor%201)pikkertonnode_1334156507[new]loadvalue%20(Monitor%201)pikkertonnode_1334156507
其對我來說工作得很好我剛剛使用了示例url,那就好了。也許問題是pikkertonnode_1334156507在所請求的URL中以/ n結尾爲 –