当前位置: 代码迷 >> ASP.NET >> href用法,该怎么处理
  详细解决方案

href用法,该怎么处理

热度:5839   发布时间:2013-02-25 00:00:00.0
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>
  相关解决方案