我有这样的设置:views/people 和 viewsModel/people.js 之间的敲除绑定 A button to call AJAX to jsreport server to print PDF Button in views/people
<button id="printPdf"
data-bind="ojComponent: {component: 'ojButton}">
</button>
在 viewsModel/people.js 中,对 jsreport 服务器的点击事件调用
self.someotherstuff = ko.pureComputed(function () {
......
//print button
self.print = $("#printPdf").click(function () {
$.getJSON(
//some logic
).then(function (){jsreport.serverUrl = 'http://localhost:5488';
var request = {
template: {
"shortid":"rJPUhdmv"
}};
jsreport.render('_blank', request);
})
....
}
但是为什么总是收到 2 个 GET 请求而不是 1 个呢?编辑:整个打印按钮在上面的纯计算中