starrwriter
Programmer
I have written a preview page function for the WYSIWYG editor I'm developing, but it doesn't work and I can't figure out why. I get error message "Access denied" on one line. Here's the script:
function previewPage() {
iView.document.execCommand('SaveAs',null,'popup');
win.document.write('popup'); //Error here: Access denied
win = window.open(", ", 'popup', 'toolbar = yes, menubar = yes, status = yes, scrollbars = yes, resizable = yes');
}
(iView is the name of the iframe where the HTML is written for the page under construction.)
I have a script to preview the outerHTML (body only), but that doesn't include effects from javascript or CSS in the <head> section. I know the page has to be saved before it can be previewed in full, which is why I inserted the execCommand SaveAs line first. But why won't the script write the HTML for the popup page to be opened?
function previewPage() {
iView.document.execCommand('SaveAs',null,'popup');
win.document.write('popup'); //Error here: Access denied
win = window.open(", ", 'popup', 'toolbar = yes, menubar = yes, status = yes, scrollbars = yes, resizable = yes');
}
(iView is the name of the iframe where the HTML is written for the page under construction.)
I have a script to preview the outerHTML (body only), but that doesn't include effects from javascript or CSS in the <head> section. I know the page has to be saved before it can be previewed in full, which is why I inserted the execCommand SaveAs line first. But why won't the script write the HTML for the popup page to be opened?