首页 相关文章 window.location.href出问题分析思路

window.location.href出问题分析思路

今天在公司给别的同事改bug,其中一个是window.location.href 不起作用

alert(ok)
window.location.href = ‘/event/index.php?from_city=’ + site;

上面的alert(ok);是不跳转后用来调试的,页面反映为现实url的值,但不进行跳转,分析思路是window.location.href出问题,所以尝试了常用的调试方式,比如:

判断是否是在包含页里面:采用

window.parent.location.href=url; //这个完全否决,因为不是这种情况

采用 window.href location.href document.href均无效

于是跳出判断函数内部出错,分析页面出发该函数的事件,原来是这样的:

a href=javascript:void(0) onclick=changeSite(’200′)

发现问题:a href=javascript:void(0) ,于是修改为:

a href=java...[ 查看全文 ]

2016-02-20 标签:

window.location.href出问题分析思路的相关文章

手机页面
收藏网站 回到头部