简体   繁体   中英

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.

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.

How can I escape this loop?

The javascript that makes the final redirection with the timeout is this

   function doGoal(url) {
   /*small delay to allow for analytics scripts to send their tracking pixel*/
   setTimeout('document.location = "' + url + '"', 1000)
   }

我删除了javascript重定向,并添加了元刷新和指向最终页面的链接,以防重定向失败,并且一切顺利

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM