开发者

Best filename to include JQuery in an embedded application

I'm using JQuery for an embedded system that is isolated from the outside word. Therefore jquery exists on the local server (the embedded system). The question is: what would be the best file name to include JQuery in my html?

  1. <script type="text/javascript" src="js/jquery.js"></script>
  2. <script type="text/javascript" src="js/jquery-1.6.4.js"></script>

I searched Stackoverflow and found the following threads despite of being useful they don't an开发者_如何学Pythonswer my specific question in this scenario:

  • What is the best way to include latest version of jQuery?
  • What is the best way to include jQuery in DotNetNuke 4.8.x?

Because if later we switch to a newer version, I don't have to go through the html files and update them. This is an embedded system and once it's running we hardly update any file. Besides the customer doesn't need to know the version of the libraries and developers know the version already.


jquery-1.6.4.js is better because

  • it helps clearly identify which version is being used
  • it prevents possible caching issues that might arise if you changed the jQuery version but not the file name.


Option 2.

Because when you update the version the version number of the file name will act as a cache buster.

This means if a browser caches your file, a change in file name will force it to redownload, as it's a completely new file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜