Open window
Simple javascript source code to open popup windows
function open_window(url){
var wparams = 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
wparams += 'scrollbars=0,resizable=0,width=280,height=150';
var window = window.open(url, 'window_name', wparams);
window.focus();
}
function create_window(content){
var wparams = 'toolbar=0,location=0,directories=0,status=0,menubar=0,';
wparams += 'scrollbars=0,resizable=0,width=280,height=150';
var window = window.open('', 'window_name', wparams);
window.document.open();
with(window.document){
write(content);
write("<br/>");
write("<a href=\"javascript:self.close();\">Close window</a>");
}
window.document.close();
window.focus();
}
//Example:
open_window('http://www.jonasjohn.de/') or create_window('<b>Test</b>');
Url: http://www.jonasjohn.de/snippets/javascript/open-popup-window.htm
Language: JavaScript | User: ShareMySnippets | Created: Oct 16, 2013