function mypopup(pid,h,w)
{
mywindow = window.open('http://www.test.com?pid=" + pid + "', 'mywindow','toolbar=no,location=no,menubar=no,width=" + w + ",height=" + h + ",resizable=no,scrollbars=no')
}
在HTML文件中,这是我链接的结构:
<a href="#" onclick="mypopup("K1i2phr4eVEf4BexlfBgym_WM6Ig7U9a","436","503")">text</a>
无法让它发挥作用...我知道我错过了一些简单的事情,有人可以帮忙吗?
答案 0 :(得分:0)
这样调用:语法错误
function mypopup(pid, h, w) {
mywindow = window.open('http://www.test.com?pid=' + pid , 'mywindow', 'toolbar=no,location=no,menubar=no,width=' + w + ',height=' + h + ',resizable=no,scrollbars=no');
}
<a href="#" onclick='mypopup("K1i2phr4eVEf4BexlfBgym_WM6Ig7U9a","436","503")'>text</a>
答案 1 :(得分:0)
mywindow = window.open('http://www.test.com?pid=' + pid, 'mywindow','toolbar=no,location=no,menubar=no,width="' + w + '",height="' + h + '", resizable=no,scrollbars=no')
答案 2 :(得分:0)
<a href="#" onclick="mypopup('K1i2phr4eVEf4BexlfBgym_WM6Ig7U9a','436','503')">text</a>
答案 3 :(得分:0)
试试这些:
<a href="javascript: mypopup('K1i2phr4eVEf4BexlfBgym_WM6Ig7U9a','436','503')">text</a>