I want to open preview window with ability to confirm it, so I want to use window.open() and append some checkbox at bottom of document. I think it should be something like
var w = window.open("http://mypage.aspx", "_parent", "width=800,height=800");
w.document.write("<input type='checkbox' id='IsConfirmed' />");
but this code is not working… It doesn’t load content of http://mypage.aspx.
So the question is how to load content of “http://mypage.aspx” and append checkbox at bottom of page?
Thanks in advance!
Considering that
http://mypage.aspxis a valid page path, it will take time to load so playing with the document right at the start might not be a good idea. It could also be why it does not seem to get loaded.Using onload on the window will make sure that you are appending the checkbox after the page has been fully loaded… This will prevent some errors.