How does Twitter do noscript redirection and what's the point?

Twitter has this in its tags:

<noscript>
<meta http-equiv=refresh content="0; URL=/?_twitter_noscript=1" />
</noscript>

The body has this:

  <noscript>
    <div class="front-no-js-warn">
      <h3>Twitter.com makes heavy use of JavaScript</h3>
      <p>If you cannot enable it in your browser preferences, you may have a better experience on our <a href="http://m.twitter.com">mobile site</a>.</p>
    </div>
  </noscript>

with CSS:

.front-no-js-warn{position:absolute;top:50px;
left:50%;
height:30px;
width:798px;
padding:15px 20px;
margin:0 0 0 -418px;
z-index:2;color:#ddd;
line-height:1.5;
background-color:#111;
background-color:rgba(20,20,20,.9);
-webkit-border-radius:6px;
-moz-border-radius:6px;
border-radius:6px;
}
.front-no-js-warn h3{color:#FEC632;font-weight:bold;}
.front-no-js-warn a{color:#75C6F7;}

So when you turned off javascript, you see div class="front-no-js-warn"

My question is what is the redirect point to ?_twitter_noscript=1and how do I do this? I tried to do this and it is endlessly trying to redirect.

+3
source share
2 answers

You should check $ _GET ['_ twitter_noscript = 1'] (php) on your index page, and if it is present, another page will be displayed.

Example:

<?php
    if ($_GET['_twitter_noscript']) {
        echo "Display javascript-less page";
    } else {
        echo "noscript...meta refresh... etc etc ... /noscript";
        //Rest of the page...
    }
?>
+2
source

They do this to determine which users have javascript disabled, and tell them that as a result, they will not experience all that Twitter has to offer.

+1
source

All Articles