Advertisement
Aurangajeb

Redirect current page based on the URL index

Aug 3rd, 2021
1,636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.41 KB | None | 0 0
  1. //Redirect current page based on the URL index
  2. //https://www.developintelligence.com/blog/2016/04/javascript-redirect-how-to-redirect-a-web-page-with-javascript/
  3. jQuery(document).ready(function( $ ){
  4.       // Your code in here
  5.         if (window.location.href.indexOf("user_id") > -1) {
  6.           setTimeout(function() {
  7.             window.location.href = "https://example.com";
  8.           }, 1000);
  9.       }
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement