The application I am maintaining is some kind of documentary portal, where the users can select a HTML document in a list (table of content) to display it within the page.
This content can contain links, and we do not want to loose our main page. That's the reason why the content is displayed in a IFrame (and also for other historical reasons).
Now, I have been asked to add a Print Preview functionality. This would open a new window with the content that is currently displayed in the IFrame (enabling the user to see it without all the extra information our own page contains).
The customer want this preview to work whatever and wherever the content is located (can be on one of his website on the same domain but different sub-domain, or on a different domain).
As it is not possible to have the printPreview button inthe IFrame (as I do not control the page displayed), I put it in the main document.
Then, when trying to get the location.href (using
) or even just trying to print the iframe (using
), I got a Permission denied (because of Cross-domain security, from what I figured)
So now, I should admit I have no idea of what I could do...
Any idea?
Pat
This content can contain links, and we do not want to loose our main page. That's the reason why the content is displayed in a IFrame (and also for other historical reasons).
Now, I have been asked to add a Print Preview functionality. This would open a new window with the content that is currently displayed in the IFrame (enabling the user to see it without all the extra information our own page contains).
The customer want this preview to work whatever and wherever the content is located (can be on one of his website on the same domain but different sub-domain, or on a different domain).
As it is not possible to have the printPreview button inthe IFrame (as I do not control the page displayed), I put it in the main document.
Then, when trying to get the location.href (using
Code:
window.frames['myFrame'].location.href
Code:
window.frames['myFrame'].focus();
window.frames['myFrame'].print();
So now, I should admit I have no idea of what I could do...
Any idea?
Pat