I'm currently linking to jquery from Google. This way I'm not hosting the file on my server.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
Anyone knows of a similar service that's available for the individual jquery plugins?
There isn't one out there yet (though some sparse plugins have their own CDN, like jQuery Tools).
However, the jQuery team is working on this with Media Temple (which currently hosts jquery.com and other related sites)...I'm not sure how far along it is though.
Related
For a website with live "edit-in-place", first I get the jQuery library from the fastest CDN for free ...
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
... and on top of that I need the Jeditable plugin, listed in the jQuery repository at jQuery on this page!
Is this plugin also hosted on Jquery CDN?
If not, whats the use of jQuery having a plugin in the repository without hosting the script?
In other words whats the use of a plugin repository?
How to load a script directly from jQuery repository?
<script src="................................../jeditable.js"></script>
http://www.appelsiini.net/projects/jeditable
http://www.appelsiini.net/projects/jeditable/default.html
https://github.com/tuupola/jquery_jeditable
I'm mostly using cdnjs for common js things.
A search for jeditable.js gives you the link and the script tag for easy copy-pastin'.
<script src="https://cdnjs.cloudflare.com/ajax/libs/jeditable.js/1.7.3/jeditable.min.js"></script>
Plugins are most likely not hosted on jquery CDN, because they are most likely not written by the people behind jquery.
Discoverability? Don't know how their plugin listing works, but may have been from users submitting their plugins for example. Actually hosting the plugins would add another level of unnecessary complexity. Especially if the goal is discoverability, i.e. an easy place for jquery new-comers to see what else might be possible.
I don't know how "cloudflare one day hosts something and otherday it doesnt work without notice". At least not with cdnjs, which has always worked for me. But if you're worried, just download the script and host it yourself instead...
I have noticed that the bootstrap provides a jQuery link that you can use to run the JavaScript files. What I would like to know is if it matters what jQuery link you use.
Currently, the code provided by the bootstrap site is:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
Would it hurt if I used these links below to replace the above link:
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
It will not create any issue as jQuery library version is same. as per your link both files version is same that means files is same but loads from different server.
Main thing is you need to use jQuery library suggested by bootstrap
jQuery (necessary for Bootstrap's JavaScript plugins) .
you can download that files to your local project folder and use in project it will work fine.
jQuery Migrate Plugin
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
jQuery Migrate Plugin simplify the transition from older versions of
jQuery. The plugin restores deprecated features and behaviors so that
older code will still run properly on jQuery 1.9 and later.
These two file are exactly the same therefore you should not see any difference.
No. It will be not. Because the links which you have mentioned will have the same jquery files and those links are nothing but different CDNs that deliver webpages and other Web content to a user based on the geographic locations of the user, the origin of the webpage and a content delivery server.
As per the mentioned link this service is effective in speeding the delivery of content of websites with high traffic and websites that have global reach. The closer the CDN server is to the user geographically, the faster the content will be delivered to the user.
SOLUTION: For everyone interested: turned out the solution was moving all files that use DoJo beneath the jQuery UI files, so that jQuery UI is fully loaded before any DoJo stuff loads. Moved them all in the footer in that order (jQuery, then jQuery UI and then alle DoJo related files).
Still wondering though why this has been an issue in WP 4.1, while it worked perfectly without the fix in WP 4.0.
I'm running a Wordpress website which uses both jQuery and DoJo (part of the ArcGIS JS API, loaded from http://js.arcgis.com/3/12/).
After recently upgrading from Wordpress 4.0.1 to 4.1, things broke.
Dojo is returning multiple Error: multipleDefine errors.
Basically it looks like DoJo tries to load a new instance of jQuery, which it shouldn't, since WordPress has loaded jQuery already and there isn't a jQuery module available in the DoJo map. Furthermore, this issues seems to only exists in WordPress, not in a jsfiddle I made including exactly the same scripts.
For debugging purposes I first disabled all WordPress plugins, without any result; the problem kept existing. I went on and found a couple of interesting things. But I'm really stuck in the further debugging proces. I know the scope of this question is rather broad, but any thoughts at all are very much appreciated.
What I know so far/that i'm wondering about:
-Things stopt working after upgrading to WordPress 4.1
-In the info of the multipleDefine error it states https://js.arcgis.com/3.11/jquery.js, which is weird: it shouldn't be looking for jQuery there, since it's already included in Wordpress
-Things break as soon as I included the ArcGIS Javascript API, which includes DoJO
-In addition: leaving WordPress out still gives trouble in this jsfiddle, although dojo isn't looking for jQuery right now http://jsfiddle.net/dhunink/mry5vn3s/8/
<script>
var dojoConfig = {
isDebug: true,
async: false
};
</script>
<script src="http://js.arcgis.com/3.12/"></script>
The things mentioned above leads me to the conclusion that something changed in the last WordPress release that effects my script, although I can't find anything in the release notes that could be linked to my issue.
Any thoughts, suggestions of comments are highly appreciated! Feel free to see all in action at https://tpgrf.nl/testserver/alpha/topotrainer/provincies/.
SOLUTION: For everyone interested: turned out the solution was moving all files that use DoJo beneath the jQuery UI files, so that jQuery UI is fully loaded before any DoJo stuff loads. Moved them all in the footer in that order (jQuery, then jQuery UI and then alle DoJo related files).
Still wondering though why this has been an issue in WP 4.1, while it worked perfectly without the fix in WP 4.0.
When I make changes to CSS and JavaScript files, my users often have to reload a couple of times to get the changes (obviously to clear out the cache).
I was wondering if someone had a really good experience with a plugin to solve this issue.
I am currently using grails 1.3.7 and I use tomcat for my production environment.
Seems to me that this might be the best option for me.
As you say, the cached-resources plugin is a great option.
You need to install it alongside the resources plugin. Assuming the resources plugin is installed and configured correctly, you don't have to do anything with the cached-resources plugin in order to get it to work correctly. Hence the apparent lack of documentation for the cached-resources plugin. Everything you need to know is linked from the resources plugin.
As has been discussed at breadth in many a forum, it is recommended to use Google's CDN for loading common js libraries. I am doing the same in my app and am loading jquery and jquery-ui from the Google cdn.
Now there have been quite a few instances where users have reported broken UI and that is a result of jquery ui not firing. e.g. jquery UI tabs/progress bars not working. Now I am wondering why this is happening and most probable reason seems to be jqueryui not getting downloaded properly from Google CDN.
Has anyone faced similar issues before? How to ensure that juqeryui is initialized/ready for each user?
There are some fallback solutions (for jQuery proper) in this answer that may be helpful.
This one in particular.