The Artima Developer Community
Sponsored Link

Web Buzz Forum
Google Code: Ajax Libraries API

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Douglas Clifton

Posts: 861
Nickname: dwclifton
Registered: May, 2005

Douglas Clifton is a freelance Web programmer and writer
Google Code: Ajax Libraries API Posted: Nov 6, 2008 3:14 AM
Reply to this message Reply

This post originated from an RSS feed registered with Web Buzz by Douglas Clifton.
Original Post: Google Code: Ajax Libraries API
Feed Title: blogZero
Feed URL: http://loadaveragezero.com/app/s9y/index.php?/feeds/index.rss1
Feed Description: Web Development News, Culture and Opinion
Latest Web Buzz Posts
Latest Web Buzz Posts by Douglas Clifton
Latest Posts From blogZero

Advertisement

ajax ala No sooner had I added Dave Shea's (of mezzoblue fame) excellent (if somewhat dated) CSS Sprites ALA article to my CSS resources category, then what does he go and do?

CSS Sprites Redux

You guessed it, he publishes a follow-up article. The reason I went looking for it in the first place, or rather found it to be the best write-up on the topic, was not so much the how, but the why of using this technique. But he kind of missed the point. Sure, he explains the ins and outs and a bit of the history of sprites, but for my money the single best reason to consider using it is the huge reduction in the number of HTTP requests you serve up when storing a bunch of similar iconic images in one master file. Once the browser downloads the single file and caches it, it's a simple matter of some integer offset math to display only that portion you need as a background image in your documents.

The latest version of the article takes the technique a step further by introducing some animation effects via John Resig's outstanding jQuery JavaScript library. But Dave misses the original point again, which I found ironic after he warns his audience that using jQuery imparts a certain overhead when downloading the library for the first time.

Ajax Libraries API

google However, I did learn something interesting here. Google Code is now hosting jQuery as part of their Ajax Libraries API project, so you can link to it without having to host it yourself. This has two benefits, it saves you a little bandwidth, but more importantly, if enough developers are doing this then chances are your visitors already have a copy of jQuery cached locally. You can also take advantage of the Google CDN if you're using Prototype, script.aculo.us, MooTools/moo.fx, or Dojo.

google.load()

Personally, I don't understand the advantage of using the google.load() method unless you plan on using the Maps, Search, or Ajax Feed APIs. Why not just load the library and start using jQuery (or whatever) like you normally would?

<script type="text/javascript"
         src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
 $('#id').method({
  // ...
 });
 // ...
});
</script>

Related Reading

Read: Google Code: Ajax Libraries API

Topic: Anyone going to VMworld next week? Previous Topic   Next Topic Topic: Emacs Completions with Hippie-Expand and Snippets

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use