求助弹窗函数
<script language= "javascript " Charset= "gb2312 ">
function showinfo(keyword){ window.open (keyword& ".htm ", "newwindow ", "height=100, width=400, toolbar=no, menubar=yes, scrollbars=no, resizable=no, location=no, status=no ")
}
</script>
我在后面调用如下:
<A onClick= "showinfo( '上海 '); " href= "# "> 上海 </A>
<A onClick= "showinfo( '北京 '); " href= "# "> 北京 </A>
<A onClick= "showinfo( '天津 '); " href= "# "> 天津 </A>
<A onClick= "showinfo( '黑龙江 '); " href= "# "> 黑龙江 </A>
为什么点击可以弹出窗口但是网址却不对
(显示无法找到该页,地址http://www.XXX.com/0)?
------解决方案--------------------//打开新窗口
function popnew(url,title,width,height){
var w = 1024;
var h = 768;
if (document.all || document.layers){
w = screen.availWidth;
h = screen.availHeight;
}
var leftPos = (w/2-width/2);
var topPos = (h/2.3-height/2.3);
window.open(url,title, "width= "+width+ ",height= "+height+ ",top= "+topPos+ ",left= "+leftPos+ ",scrollbars=no,resizable=no,status=no ")
}
------解决方案--------------------keyword + ".htm "