日期:2014-05-18  浏览次数:20464 次

href用法
<a href="javascript:bonclick();" target=_blank>共享用户</a>

function bonclick() {

 alert("共享用户才能设定共享范围");
 window.open("'CRM_new_shareuser.aspx','oa_sub_window','height=450,width=450,status=0,toolbar=no,menubar=no,location=no,left=300,top=200,scrollbars=yes,resizable=yes");
}
总是出错啊,我把 window.open("'CRM_new_shareuser.aspx','oa_sub_window','height=450,width=450,status=0,toolbar=no,menubar=no,location=no,left=300,top=200,scrollbars=yes,resizable=yes");去除连alert("共享用户才能设定共享范围");
都起不到作用,总提示无法显示网页,请问怎样解决?

------解决方案--------------------
Javascript要在<script>...</script>标签里。

<html>
<body>
<a href="javascript:bonclick();" target="_blank">共享用户</a> 
<script>
function bonclick() { 
 alert("共享用户才能设定共享范围"); 
 window.open('CRM_new_shareuser.aspx','oa_sub_window','height=450,width=450,status=0,toolbar=no,menubar=no,location=no,left=300,top=200,scrollbars=yes,resizable=yes'); 
}
</script>
</body>
</html>
------解决方案--------------------
汗死。。
JScript code
<script type="text/javascript">
function bonclick() {  
 alert("共享用户才能设定共享范围");  
 window.open('CRM_new_shareuser.aspx','oa_sub_window','height=450,width=450,status=0,toolbar=no,menubar=no,location=no,left=300,top=200,scrollbars=yes,resizable=yes');  
} 
</script>