Shouldn't we use

前端 未结 11 936
北荒
北荒 2020-12-07 09:08

I found some good cons here:

  • The noscript element only detects whether the browser has JavaScript enabled or not. If JavaScript is disabled in the Firewall

11条回答
  •  独厮守ぢ
    2020-12-07 09:27

    These days it seems almost every browser runs Javascript, but you can never know who is going to be accessing your site. These days even screen readers and web crawlers use Javascript, and sometimes make AJAX requests if they have to.

    That said, if you're going to fall back to no-Javascript, there is a much better way than a

    
    

    With this technique, you can easily refer to the Q_js class in your CSS to hide things. With the

    In short, the technique I suggested addresses all your cons 1-5, and I believe it's strictly better than using

提交回复
热议问题