1
未捕获的错误:无法解析绑定。 消息:ReferenceError:值未定义; 绑定值:文本:值。未捕获的错误:无法解析绑定
这里是我的代码
ko.applyBindings(new AppViewModel(myObject.storeRows),document.getElementById("addNewUpdateForm"));
$("#abc").live('click',function() {
$.ajax({
url: "request.json",
//GET method is used
type: "post",
//pass the data
data: data,
dataType: 'json',
success : function(response) {
function viewModelSku() {
self = this;
this.skuData = skuData;
}
var skuData = response.Rows;
ko.applyBindings(viewModelSku(), document.getElementById("Row"));
}
});
}
不使用live(),使用on()。在阅读http://stackoverflow.com/questions/2954932/difference-between-jquery-click-bind-live-delegate-trigger-and-on之前 –