firefox怎支援location.href

kkwai 2009-02-01 12:55:18
firefox怎支援location.href
echo "location.href(\"index.php\");";
ie能運行
...全文
134 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wuleying 2009-02-02
  • 打赏
  • 举报
回复
document.location.href
mengshan1986 2009-02-02
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 humanblue 的回复:]
location.href是js的代码,并不是php的代码

<script type="text/javascript">
location.href = 'http://baidu.com';
</script>
这个代码不存在兼容性问题

如果是php用类似的功能应该是
<?php
header('location:http://www.google.com/');
?>
[/Quote]
echo '<script type="text/javascript">
location.href = "http://baidu.com";
</script>'
humanblue 2009-02-01
  • 打赏
  • 举报
回复
location.href是js的代码,并不是php的代码

<script type="text/javascript">
location.href = 'http://baidu.com';
</script>
这个代码不存在兼容性问题

如果是php用类似的功能应该是
<?php
header('location:http://www.google.com/');
?>

21,887

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧