javascript - Cancel a script if directed to that page from a specific URL -
i have bit of code redirect mobile site if
<script type="text/javascript"> <!-- if (screen.width <= 800) { window.location = "http://mymobilesite.com "; } //--> </script>
i want cancel above script if direct page form speific url, like:
if (document.referrer !== "http://mymobilesite.com") { }
any appreciated
if not understanding need, want cancel script, if redirected spcific site. this, below work.
if (window.location.origin !== "http://mymobilesite.com") { // }
this not include query string, url of website including http/https .
Comments
Post a Comment