我有像这样的HTML:
<div class="row thumbnailrow" data-bind="foreach: data">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 thumbpadding" data-bind="html: HtmlText">
</div>
<div>
Run Code Online (Sandbox Code Playgroud)
获得ajax电话后:
成功:函数(数据){
$.each(data, function (i, items) {
debugger;
self.data.push(items);
});
}
Run Code Online (Sandbox Code Playgroud)
所以它将填充html绑定和谷歌chrome输出,如下所示:
<div class="row thumbnailrow" data-bind="foreach: MyProfilesData">
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 thumbpadding" data-bind="html: HtmlText"><div>
<div class="pcbtn btnpcedit" data-bind="click: EditProfile" />
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
所以这里我click: EditProfile的工作没有用,当我点击编辑按钮时,这个事件没有被触发.