代码之家  ›  专栏  ›  技术社区  ›  Upperstage

extjs:AJAX响应打开新的浏览器选项卡

  •  2
  • Upperstage  · 技术社区  · 14 年前

    如何使用extjs发出AJAX请求并将响应(PDF文件)加载到新的浏览器选项卡(或窗口)中?

    2 回复  |  直到 14 年前
        1
  •  3
  •   ceejayoz    14 年前

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

        2
  •  0
  •   Upperstage    14 年前
    // 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);