首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2012-03-12 
header(location:url)因为种种原因,用ahref 无法链到指字页面.有关人士给出下列解决办法1,响应Area的onc

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/ ";

热点排行
Bad Request.