[jQuery] Re: Keeping jquery codes up to date - best practise?
I love this place. Thanks so much everyone. My coding practises just shifted :) Steve On Mar 25, 5:55 am, MorningZ wrote: > To build on James reply > > Using more CDNs allow your user's browser to download more > simultaneously > > http://developer.yahoo.com/performance/rules.html#cdn > > On Mar 24, 2:33 pm, James wrote: > > > I think the idea is that if many sites used the Google hosted script, > > and your visitor happened to visit one of them, it's probably already > > in their browser cache, so your site will have one less file to load. > > Google has servers all over the world, so it's unlikely the service > > will be down, but it is possible I guess. Also, because of that, the > > browser might also fetch a closer file for the visitor's location > > (thus, quicker download). Additionally, since it's loading from > > Google's server, it doesn't use your bandwidth. > > > On Mar 23, 10:18 pm, Microbe wrote: > > > > Yup, I hear ya all and now understand the issue. Especially Sam's > > > point that upgrading automatically may break a function somewhere. > > > > Thanks so much for the replies. > > > > Much appreciated. > > > > I guess the last question is "is there any advantage in linking to the > > > google hosted scripts rather than hosting them myself?" > > > > Doesn't this leave the possibility that if google's server is down my > > > site breaks. Whereas if my server is down for some reason, well...it > > > is ALL down.
[jQuery] Re: Keeping jquery codes up to date - best practise?
To build on James reply Using more CDNs allow your user's browser to download more simultaneously http://developer.yahoo.com/performance/rules.html#cdn On Mar 24, 2:33 pm, James wrote: > I think the idea is that if many sites used the Google hosted script, > and your visitor happened to visit one of them, it's probably already > in their browser cache, so your site will have one less file to load. > Google has servers all over the world, so it's unlikely the service > will be down, but it is possible I guess. Also, because of that, the > browser might also fetch a closer file for the visitor's location > (thus, quicker download). Additionally, since it's loading from > Google's server, it doesn't use your bandwidth. > > On Mar 23, 10:18 pm, Microbe wrote: > > > Yup, I hear ya all and now understand the issue. Especially Sam's > > point that upgrading automatically may break a function somewhere. > > > Thanks so much for the replies. > > > Much appreciated. > > > I guess the last question is "is there any advantage in linking to the > > google hosted scripts rather than hosting them myself?" > > > Doesn't this leave the possibility that if google's server is down my > > site breaks. Whereas if my server is down for some reason, well...it > > is ALL down.
[jQuery] Re: Keeping jquery codes up to date - best practise?
I think the idea is that if many sites used the Google hosted script, and your visitor happened to visit one of them, it's probably already in their browser cache, so your site will have one less file to load. Google has servers all over the world, so it's unlikely the service will be down, but it is possible I guess. Also, because of that, the browser might also fetch a closer file for the visitor's location (thus, quicker download). Additionally, since it's loading from Google's server, it doesn't use your bandwidth. On Mar 23, 10:18 pm, Microbe wrote: > Yup, I hear ya all and now understand the issue. Especially Sam's > point that upgrading automatically may break a function somewhere. > > Thanks so much for the replies. > > Much appreciated. > > I guess the last question is "is there any advantage in linking to the > google hosted scripts rather than hosting them myself?" > > Doesn't this leave the possibility that if google's server is down my > site breaks. Whereas if my server is down for some reason, well...it > is ALL down.
[jQuery] Re: Keeping jquery codes up to date - best practise?
Yup, I hear ya all and now understand the issue. Especially Sam's point that upgrading automatically may break a function somewhere. Thanks so much for the replies. Much appreciated. I guess the last question is "is there any advantage in linking to the google hosted scripts rather than hosting them myself?" Doesn't this leave the possibility that if google's server is down my site breaks. Whereas if my server is down for some reason, well...it is ALL down.
[jQuery] Re: Keeping jquery codes up to date - best practise?
@Microbe, you could combine your single domain solution with @Steve's Google Ajax library suggestion. Rather than linking directly to a hosted Ajax library, you could link to a JavaScript file hosted by you on a single domain. In that JavaScript file, call google.load ("jquery", "1.3.2"). When your site is ready to move up to the next version, you can just update the version number in your centrally hosted JavaScript file. On Mar 23, 4:10 am, MorningZ wrote: > I totally agree with Sam don't blindly change working pages with > new versions! You're doing nothing but asking for trouble > > On Mar 23, 5:59 am, Sam wrote: > > > The risk with linking to a "latest" build is that something will break > > when the linked-to version of jquery changes. Imagine for instance > > that you made heavy use of @selectors, and were running live with > > these when the change was made from 1.2 to 1.3. Your site would break. > > Such eventualities as this are not impossible in the future. > > > I'd always recommend linking to a specific version of the code and > > testing your site before upgrading the live version of jQuery, that > > way you eliminate the possibility of bugs creeping in. Your site has a > > dependency on a specific version of jQuery to function, and you need > > to ensure that it still works when upgraded. > > > S > > > On Mar 22, 3:37 pm, mkmanning wrote: > > > > You can link to the latest major number, for > > > examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js > > > > gets you 1.3.2; it will automatically update to the next 1.#.# version > > > when available. > > > >http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js > > > > Gets you 1.2.6 (the latest version with the minor 2) > > > >http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js > > > > gets you 1.2.3 explicitly > > > > The one thing to be careful about is if you have code that is version > > > dependent, (e.g. jQuery UI), it may fall out of sync with Google's > > > update. > > > > On Mar 22, 3:54 am, Microbe wrote: > > > > > Thanks for that, but if you use it, aren't you linking to a specific > > > > version number? > > > > > Their example is > > > > "path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; > > > > > So what happens if right though my code I call that file and then > > > > 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
I totally agree with Sam don't blindly change working pages with new versions! You're doing nothing but asking for trouble On Mar 23, 5:59 am, Sam wrote: > The risk with linking to a "latest" build is that something will break > when the linked-to version of jquery changes. Imagine for instance > that you made heavy use of @selectors, and were running live with > these when the change was made from 1.2 to 1.3. Your site would break. > Such eventualities as this are not impossible in the future. > > I'd always recommend linking to a specific version of the code and > testing your site before upgrading the live version of jQuery, that > way you eliminate the possibility of bugs creeping in. Your site has a > dependency on a specific version of jQuery to function, and you need > to ensure that it still works when upgraded. > > S > > On Mar 22, 3:37 pm, mkmanning wrote: > > > You can link to the latest major number, for > > examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js > > > gets you 1.3.2; it will automatically update to the next 1.#.# version > > when available. > > >http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js > > > Gets you 1.2.6 (the latest version with the minor 2) > > >http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js > > > gets you 1.2.3 explicitly > > > The one thing to be careful about is if you have code that is version > > dependent, (e.g. jQuery UI), it may fall out of sync with Google's > > update. > > > On Mar 22, 3:54 am, Microbe wrote: > > > > Thanks for that, but if you use it, aren't you linking to a specific > > > version number? > > > > Their example is > > > "path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; > > > > So what happens if right though my code I call that file and then > > > 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
The risk with linking to a "latest" build is that something will break when the linked-to version of jquery changes. Imagine for instance that you made heavy use of @selectors, and were running live with these when the change was made from 1.2 to 1.3. Your site would break. Such eventualities as this are not impossible in the future. I'd always recommend linking to a specific version of the code and testing your site before upgrading the live version of jQuery, that way you eliminate the possibility of bugs creeping in. Your site has a dependency on a specific version of jQuery to function, and you need to ensure that it still works when upgraded. S On Mar 22, 3:37 pm, mkmanning wrote: > You can link to the latest major number, for > examplehttp://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js > > gets you 1.3.2; it will automatically update to the next 1.#.# version > when available. > > http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js > > Gets you 1.2.6 (the latest version with the minor 2) > > http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js > > gets you 1.2.3 explicitly > > The one thing to be careful about is if you have code that is version > dependent, (e.g. jQuery UI), it may fall out of sync with Google's > update. > > On Mar 22, 3:54 am, Microbe wrote: > > > > > Thanks for that, but if you use it, aren't you linking to a specific > > version number? > > > Their example is > > "path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; > > > So what happens if right though my code I call that file and then > > 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
You can link to the latest major number, for example http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js gets you 1.3.2; it will automatically update to the next 1.#.# version when available. http://ajax.googleapis.com/ajax/libs/jquery/1.2/jquery.min.js Gets you 1.2.6 (the latest version with the minor 2) http://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js gets you 1.2.3 explicitly The one thing to be careful about is if you have code that is version dependent, (e.g. jQuery UI), it may fall out of sync with Google's update. On Mar 22, 3:54 am, Microbe wrote: > Thanks for that, but if you use it, aren't you linking to a specific > version number? > > Their example is > "path:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; > > So what happens if right though my code I call that file and then > 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
Hi there, You can change the url so that it always uses the latest 1.3.x release ... http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js or even the latest 1.x release ... http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Mar 22, 2009, at 6:54 AM, Microbe wrote: Thanks for that, but if you use it, aren't you linking to a specific version number? Their example is "path: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js " So what happens if right though my code I call that file and then 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
Thanks for that, but if you use it, aren't you linking to a specific version number? Their example is "path: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"; So what happens if right though my code I call that file and then 1.3.3 comes out?
[jQuery] Re: Keeping jquery codes up to date - best practise?
You want want to try Google's AJAX library which hosts the various JavaScript effects library (JQuery, Prototype, YUI, Mootools) for you: http://code.google.com/apis/ajaxlibs/ Hope this helps! On Mar 22, 12:31 am, Microbe wrote: > Hey everyone, > > I use jquery on a number of sites (all on the same server). > > What is the best way to keep jquery scripts up to date across them all > without having to change code all over the place. > > I was thinking of using one of my domains as a host, putting > generically named files there e.g. jquery.js for the core, and then > point each page needing jquery on any site to mydomain/js/jquery.js so > that I only have to update the single file when the time comes. > > It seems like a reasonable idea...let's hear from devil's advocates or > those who have better suggestions. > > Thanks in advance.