简体   繁体   English

单击“后退”按钮并登陆到具有超时重定向的页面上

[英]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.

相关问题 单击后退按钮重定向到另一个页面 - Redirect to another page on clicking the back button 仅在“成功”登录页面上单击“后退”按钮时,而不是在“错误”页面上单击后,才重置表单 - Reset form only when clicking back button from SUCCESS landing page, NOT from ERROR page 是否可以在单击浏览器后退按钮时重新加载同一页面? - is it possible to reload the same page on clicking browsers back button? 单击浏览器后退按钮时如何保持在同一页面上 - How to stay on the same page when clicking the browser back button 在特定页面上单击浏览器后退按钮后如何重定向到主页 - How to redirect to home page after clicking browser back button, when on a particular page 按下浏览器后退按钮时需要将用户导航到登录页面 - Need to navigate users to landing page when browser back button is pressed 单击确认对话框的“取消”按钮时页面重定向 - Page redirect on clicking of “Cancel” button of a confirm dialogue 通过单击后退按钮重新加载上一页 - Reload the previous page by clicking the back button 单击确定按钮后,请进行页面重定向 - After clicking ok button, do page redirect 按下后退按钮上的重定向页面 - Ignore redirect page on press back button
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM