Tuesday, November 27, 2007

This Code is Used to Open a New Window using JavaScript

function onload(url, pageName)
{
var iHeight = 350;
var iWidth = 600;
var str = "scrollbars=No,resizable=No,width=" + iWidth + ",height=" + iHeight + ",menubar=No,toolbar=No,top=" + ( ( screen.availHeight / 2) - ( iHeight / 2 ) )+ " ,left=" + ( ( screen.availWidth / 2) - ( iWidth / 2 ) );
window.open( url, pageName, str );
}

Notes: If you want to open a new window from a href, set href="javascript:void(0);"