I was recently asked by a colleague to help in a requirement with javascript.
She wants to have a popup window with a title on it. Normally it will have the url of the window as title.
The below is an example to get a title as we want.
function popitup2()
{
newwindow2=window.open('','name','height=200,width=150,resizable=1');
var tmp = newwindow2.document;
tmp.write('<--html-><--head-><--title->popup<--/--title->');
tmp.write('<--/head-><--body-><--p->this is once again a popup.<--/p->');
tmp.write('<--/body-><--/html->'); tmp.close();
}
This resolved her problem. Thanks to Kyle Varga
Here's an even simpler way, especially when you have other HTML content in the pop up window.
ReplyDeletefunction popitup2()
{
newwindow2=window.open('','name','height=200,width=150,resizable=1');
newwindow2.document.title='Test Window';
}