当前位置: 代码迷 >> JavaScript >> header("location:url"),该如何处理
  详细解决方案

header("location:url"),该如何处理

热度:136   发布时间:2012-03-12 12:45:33.0
header("location:url")
因为种种原因,用a   href 无法链到指字页面.有关人士给出下列解决办法

1,响应Area的onclick事件来跳转。

2,跳转方式用header( "location:url ");

服务器支持jsp脚本,但我不会JSP 不知道在js中如何使用header.


------解决方案--------------------
在JSP里用
<%@page contentType= "text/html;charset=utf-8 "%>
<%
response.addHeader( "Location ", "http://www.host.com/ ");
%>

或者,在JS里,也就是页面里,响应某个事件后调用
location.href = "http://www.host.com/ ";
  相关解决方案