Aurangajeb

Redirect current page based on the URL index

Aug 3rd, 2021
848
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data