我想知道这段代码有什么问题,它会抛出一个语法错误:意外标记“anotherFuction如果我添加该anotherFunction
部分。有人可以解释为什么,JavaScript 让我对所有这些调用函数的不同方式感到困惑。
var ajax = {
parseJSONP : function(result) {
console.log(result)
//iterate each returned item
$.each(result.items, function(i, row) {
$('#listview_test').append('<li><a href="#headline"><img src="' + row.volumeInfo.imageLinks.thumbnail + '" class="ui-li-has-thumb"/><h3>' + row.volumeInfo.title + '</h3></a></li>');
});
//end iteration of data returned from server and append to the list
$('#listview_test').listview('refresh');
// refresh the list-view so new elements are added to the DOM
}
//error is here, I just wanted to add another function here to do
something
anotherFuction : function(){
}
}
}