Javascript library's


#1

Hey all,
I’m a newby web designer. I just finished the O’Reilly book: HTML, CSS, and XHTML.

My question is javascript. I’ve been looking at sites, tutorials, and books and it seems like there are several libraries available to javascript code.

Does dreamhost support a particular flavor? ie jquery, sriptaculous? These are the only 2 I know of, but I’m curious how does DH “get” the libraries that you (the programmer) have decided on?

Maybe this is a conceptual error on my part?

Many thanks


#2

To us, JavaScript is just files — like anything else that’s purely client-side, like Flash or Java, we don’t have to do anything specific to support it it. If you need to use a JS library, just upload the library file to your site and load it. (For instance, to use JQuery you’d download jquery-1.6.2.min.js and upload it to your site, then link to that with a tag.


#3

andrewf,
thanks for the reply. i’m still new to JS programming. I’ve looked at a couple of books: of course O’relly Headfirst. But also, “JQERY in Aciton”. Do you, ahem, suggest anyone/book/site in particular?:slight_smile:


#4

i suggest you check out the jQuery website. The documentation is pretty good, even if you don’t know anything about JS.


#5

There are couple popular JavaScript libraries you can use. You have the option of hosting the library on your site or linking to an external source.

Personally, I link to an external source due to how browsers behave in caching JavaScript.

Take a look at Google hosting JavaScript libraries: http://code.google.com/apis/libraries/


#6

thanks for the tip. I didn’t know you could link externally. seems like that could be slower, though


#7

It can actually be faster, believe it or not — since Google’s JavaScript libraries are used by other sites, and Google sets some pretty aggressive caching headers, a lot of users are likely to already have the scripts you’re using in their cache.


#8

…and google uses distributed geographic CDN, meaning that if the file will be fetched by the browser it will not have to come from downtown LA over how every many hops, it will get served by a google server much nearer the user.