tags:

views:

52

answers:

2

How can I make an AJAX request using Ext JS and have the response (a PDF file) load into a new browser tab (or window)?

+3  A: 

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.

ceejayoz
A: 
// 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);
Upper Stage