Reputation: 2257
How do you create a Web Popup Window without referring to a new html file?
All the codes I've found requires to refer to a new file where the popup document sits.
Thanks for you help!
Upvotes: 0
Views: 677
Reputation: 348992
Pass about:blank
as the target:
window.open('about:blank', 'name_of_window', 'popup');
If you want to manually construct a document:
var popup = window.open('about:blank', 'name_of_window', 'popup');
if (!popup) { // popup is `null` if the window is blocked
// Otherwise, popup is the Window object of the popup
popup.document.write('Test');
}
Upvotes: 1