- 我有一个 js 函数,当我将 async 设置为 false 时,它会作为新函数打开 窗口,
- 但是当我将 async 设置为 true 时,它会显示为弹出
- 我需要使代码像 true 一样异步,但它应该以新的方式打开 窗口不是弹出的
- 你们能告诉我如何发出异步请求以便 新窗口不会作为弹出窗口加载。
- 是否有 window.open 的替代方法
在下面提供我的代码
// debugger; Ext.Ajax.request({ async: false, url: sports.util.Utils.getContextPath() + '/tabClicks.do',
最佳答案
您的代码有点奇怪,因此很难正确进行调整,但这就是要点:
showNewWindow: function(menu) {
var me = this,
newWindowId = sports.util.Utils.randomString(12);
//
// Make a synchronous request so that the new window will
// not load as a popup.
//
debugger;
var popup = sports.util.Utils.openNewWindow('', 'menu', {}, null, null, newWindowId);
Ext.Ajax.request({
async: false,
url: sports.util.Utils.getContextPath() + '/tabClicks.do',
params: {
oldWindowId: sports.util.Utils.getWindowName(),
newWindowId: newWindowId
},
success: function() {
popup.location.href = "/desktop/main";
},
scope: me
});
},
关于javascript - window.open 的替代方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32635231/