使用onclick跳转到其他页面/跳转到指定url


☆如果是本页显示可以直接用location,方法如下:

  ①onclick="javascript:window.location.href=' URL'"
  ②onclick="location=' URL'"
  ③onclick="window.location.href=' URL?id=11'"
☆如果页面中有frame可以将在location前面添加top.mainframe.frames['right_frame'].location
实例:

<input type="button" value="新建下级部门/成员单位" class="BigButton" onClick="location='dept_new.aspx?dept_id=<%=ViewState["DeptId"]%>';" title="新建下级部门/成员单位"><br><br>
<INPUT class="BigButton" title="删除当前部门/成员单位" onclick="delete_dept('<%=ViewState["DeptId"]%>')" type="button" value="删除当前部门/成员单位">


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM