Reputation: 6868
Is there a way to recognize that javascript is disabled on the user's PC and not include the jQuery file for people who won't use javascript?
It'll improve performance for those who have disabled javasript.
thanks in advance.
Upvotes: 2
Views: 83
Reputation: 1595
The web browser will not request resources (or execute script) defined by <script>
tags when JavaScript is not enabled. There is no need to avoid loading jQuery via Javascript. You can simply use a <script>
tag to include the jQuery library - the browser will request the file when JavaScript is enabled, and it will not request the file when JavaScript is disabled.
Using Fiddler or Firebug's Net tab you can watch each HTTP request made by the browser. When JavaScript is not enabled the scripts are not requested at all.
Upvotes: 3
Reputation:
It's not an issue. If Javascript is disabled the file will not be loaded.
Upvotes: 4