How can I make an AJAX request using Ext JS and have the re开发者_如何转开发sponse (a PDF file) load into a new browser tab (or window)?
I would not use an AJAX request for this, as you're not updating the page they're currently on in any way. I'd just have a direct, normal link to the PDF generation URL.
// 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);
精彩评论