I\'m creating a popup window with no URL source using window.open(). I don\'t give it a URL because soon I\'ll want to post a form to it. However, in the meantime I\'d lik
<a href="#" onclick="return test();">Test</a>
<script type="text/javascript">
function test() {
window.open('javascript:opener.write(window);', '_name', 'width=200,height=200');
}
function write(w) {
w.document.write("Hello, World.");
}
</script>
Works in IE 6, 7 & 8, Opera 9.6, Firefox 2 & 3. Does not work in Safari for Windows 3 & 4 or Google Chrome.
When it does work, it results in a pretty ugly URL in the Location box.
If the browser support listed above is acceptable, you can use the solution provided, otherwise I'd do what David said and window.open('Loading.htm' ...)
where Loading.htm
contains whatever content you want to display (you should probably keep it lightweight otherwise it might take longer to load and render than the form will to POST).
Another workaround is to open an empty "blank.htm" file on your site, then do the document.open() to access it
Also note that the winName you supply in IE must NOT have spaces... if so it will fail.
IE considers "about:blank" to be a insecure URL and it won't let you talk to it. I would create a "Now Loading..." static HTML file and open that instead.