码迷,mamicode.com
首页 > 其他好文 > 详细

后台判断错误弹窗,跳转到首页。

时间:2017-09-24 11:36:59      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:code   http   cat   mis   location   脚本   参数错误   href   span   

if(!$id){
  exit("<script>alert(参数错误!);window.location.href=/</script>");
}

window.location.href=‘/‘    //跳转到首页

exit() 函数输出一条消息,并退出当前脚本。

该函数是 die() 函数的别名。

 

后台判断错误弹窗,跳转到首页。

标签:code   http   cat   mis   location   脚本   参数错误   href   span   

原文地址:http://www.cnblogs.com/yangzailu/p/7586597.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!