[英]Clicking the back button and landing on a page with a timeout redirect to the same page
I have a page with some products that when their link is clicked the next page is a "You're leaving the website to go there" type of page which uses javascript to redirect to the final destination after a setTimeout. 我有一个包含一些产品的页面,单击它们的链接时,下一页是“您要离开网站前往那里”类型的页面,该页面使用javascript在setTimeout之后重定向到最终目标。
However if the user clicks the back button they he goes back to the "You're leaving the website to go there" page and ocourse gets redirected again to the same page he was before clicking the back button. 但是,如果用户单击“后退”按钮,他们将返回“您要离开网站去那里”页面,而ocourse将再次重定向到他单击“后退”按钮之前的页面。
How can I escape this loop? 我如何才能摆脱这种循环?
The javascript that makes the final redirection with the timeout is this 使用超时进行最终重定向的JavaScript是这样的
function doGoal(url) {
/*small delay to allow for analytics scripts to send their tracking pixel*/
setTimeout('document.location = "' + url + '"', 1000)
}
我删除了javascript重定向,并添加了元刷新和指向最终页面的链接,以防重定向失败,并且一切顺利
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.