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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -