I have this function:
javascript:
function popup(mylink, windowname, w, h)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, "width=w,height=h,scrollbars=yes,toolbar=no" );
return false;
}
html:
<a href="test.html" onClick="return popup(this, 'Test', '400', '600')">test</a>
Im trying to insert variable w
and h
in the string but without success. What is the proper way to do it in javascript?