咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
有的时候别人可能会故意刷我们的网站链接,在后面加上参数来访问网站,例如‘http://www.landui.com/?_t=1539913651’我们想实现的效果是自动去掉后缀包含?部分,实现代码如下
if(top != self){
top.location=self.location;
}else{
var url = location.search;
if(url){
var old_url = window.location.href;
var new_url = old_url.substring(0, old_url.indexOf('?'));
self.location = new_url;
}
}