AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Jquery cdnjs10/14/2023 ![]() ![]() ![]() R.js and a build configuration is included in the tools/ folder. See the Optimization page for more information. These instructions assume Node is being used. To use the optimizer, you need node.js or Java 6 installed. Start the server by typing node tools/server.js from the command line, and then go to localhost:8888/How to optimize it using r.js Just serve up the static file server in tools/. The main file of this setup is It is loaded from app.html by this line:ĭefine (, function ( $ ) ) How to see it in action ![]() Modify the jQuery path in app.js, to for example ///ajax/libs/jquery/1.10.2/jquery.min Project structure The jQuery 2 used in this project does not work with those browsers, a 1.X release is needed. If you want IE6-8 support, clone this repo, but replace the jQuery file with a jQuery 1.X release. Please note that in order to be able to load an asset from a CDN in the built files, all the plugins that needs that asset as a dependency have to call define(). That can benefit users, who might already have the file in their browser cache, and therefore don't have to download it again. In this example, we set the path of jQuery to point to a google-hosted CDN. If you'd like to see how to load jQuery plugins that do not call define, without modifying the source, see the example with shim config In this example, we have modified the plugins to be wrapped in a define(), rather than using the shim configuration. This example shows one way to load jQuery and jQuery plugins with require.js. Example of using require.js to load jQuery from a CDN ![]()
0 Comments
Read More
Leave a Reply. |