-9
真的很困惑,我找不到任何错误!Chrome语法错误:意外标识符
真的很困惑,我找不到任何错误!Chrome语法错误:意外标识符
您不能在对象文字中声明变量。 Move pid
outside:
var pid = ...
$.ajax({ ... });
你不能有一个var
声明对象文本的内部。您只能在对象文字中使用key: value
格式的对象属性。
我想你是想要这样的事情。
var pid = $("span#live-news:first").attr("id");
$.ajax({
// all the AJAX options go here
});