2010-07-05 194 views
2

如何使用Ext JS创建AJAX请求并将响应(PDF文件)加载到新的浏览器选项卡(或窗口)中?Ext JS:AJAX响应打开新的浏览器选项卡

+2

为什么要为此发出AJAX请求? – ceejayoz 2010-07-05 17:37:56

+0

好问题;在思考一下这个之后,我不应该使用AJAX。如果您将此评论作为答案,我会接受它。 – Upperstage 2010-07-05 17:47:49

回答

3

我不会为此使用AJAX请求,因为您没有以任何方式更新它们当前所在的页面。我只是直接链接到PDF生成URL。

+0

如果某些东西形成要发布到url的数据并需要在单独的窗口中响应,该怎么办? – prashu132 2013-06-17 02:53:43

0
// Create an IFRAME. 
var iframe = document.createElement("iframe"); 

// Point the IFRAME to GenerateFile, with the desired attributes as arguments. 
iframe.src = 'something.html'; 

// This makes the IFRAME invisible to the user. 
iframe.style.display = 'none'; 

// Add the IFRAME to the page. This will trigger a request to URL. 
document.body.appendChild(iframe); 
相关问题