Google AJAX API (was: CodeIgniter AJAX With jQuery)
Posted: 28 May 2008 03:00 AM   [ Ignore ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

For those of you keeping an eye out for these things: nice tutorial by Michael Wales.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 28 May 2008 07:31 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  814
Joined  02-28-2006

What do you make of the new google AJAX api then Ingmar? it’s creating a bit of a buzz anyways.

 Signature 

Wee-kee- dee-kee!
Who’s that drivin’ the bus -next stop the weekend!
™T.Gee. (Q n’ A -w/ way more Q’s than A’s) wink

Profile
 
 
Posted: 28 May 2008 07:38 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

It’s on my “things-I-need-to-play-with-real-soon-now” shortlist.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 28 May 2008 07:41 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  814
Joined  02-28-2006

Just watched the you tube video for it, turns out CDN is content delivery network, and it boils down the the fact Google is hosting the javscript libraries, and smartly caching them etc. this way there isn’t a performance issue for each page loading jQuery, dojo, prototype, etc. The libraries can belinked there and are minified etc. Hey why not.
sorry I thought it had something to do with AJAX methods.

 Signature 

Wee-kee- dee-kee!
Who’s that drivin’ the bus -next stop the weekend!
™T.Gee. (Q n’ A -w/ way more Q’s than A’s) wink

Profile
 
 
Posted: 28 May 2008 08:11 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

Just read up on it, too. Quite a smart idea, actually.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 28 May 2008 08:12 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  137
Joined  12-24-2007

Cool idea.

Now I can link to compressed stylesheets at Yahoo (YUI) and point my JS to Google. Throw in some images hosted on S3 and I’m being very nice to my host.

 Signature 

Trifecta Interactive Marketing | Austin, TX

Profile
 
 
Posted: 29 May 2008 03:04 AM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Just took a look at this too. Found it from the link on Web Resources Depot and just can’t get it to work for the life of me. What exactly am I doing wrong?

I followed the advice on this page here and tried adding this code to a page :

<sc*ipt src="http://www.google.com/jsapi"></sc*ipt>
<
sc*ipt
// Load jQuery
google.load("jquery", "1");
</
sc*ipt>

but jQuery isn’t being loaded into the page.

Any ideas what I am doing wrong?

Thanks.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 May 2008 03:13 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

You are, of course, closing </sc*ipt> again, right? Well, if it’s still not working I’d say go for the
alternative approach:

<sc*ipt src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></sc*ipt>

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 29 May 2008 03:28 AM   [ Ignore ]   [ # 8 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Hi Ingmar,

Yep it was closed until I forgot to exchange the r in there for a *. The forum unfortunately caught me out on that one and stripped it out. Will go back and add it in for others reading.

I did see on their site that you can link directly but I think in doing it that way you don’t get all the clever caching methods and zipping / minifying stuff do you? Could be wrong though but I thought I had read that you don’t get them unless you are using the API?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 May 2008 07:13 AM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  814
Joined  02-28-2006

Right without checking I would of just linked it in the head section, but if that doesn’t take advantage of the caching etc. then best to go with their methods. The script snippet you are using could be placed externally within the site though, would that effect the caching etc.? That would eliminate the chances of making a mistake in an embedded script on a page someplace.

 Signature 

Wee-kee- dee-kee!
Who’s that drivin’ the bus -next stop the weekend!
™T.Gee. (Q n’ A -w/ way more Q’s than A’s) wink

Profile
 
 
Posted: 29 May 2008 07:31 AM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15368
Joined  05-15-2004

Either method is fine:

You can access the libraries in two ways, and either way we take the pain out of hosting the libraries, correctly setting cache headers, staying up to date with the most recent bug fixes, etc.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 29 May 2008 07:37 AM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Still can’t get it to work though unfortunately wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 May 2008 08:42 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  368
Joined  02-26-2008
Mark Bowen - 29 May 2008 07:37 AM

Still can’t get it to work though unfortunately wink

Best wishes,

Mark

Not sure why the direct link isn’t working for you (it works for me).  But for the google.load() method, you’re not appending your Google API Key to the end of the source URI.  That’s needed for that method to work.

Read the developer’s guide.  You can get your API key here.

Profile
 
 
Posted: 29 May 2008 08:53 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  814
Joined  02-28-2006

Ahhh the API key, don’t they use that for some things to limit usage, like say if you are using feeds.
I don’t see them limiting the use of this api, but sometimes it’s the case if I remember correctly. Maps maybe they limit.

 Signature 

Wee-kee- dee-kee!
Who’s that drivin’ the bus -next stop the weekend!
™T.Gee. (Q n’ A -w/ way more Q’s than A’s) wink

Profile
 
 
Posted: 29 May 2008 09:32 AM   [ Ignore ]   [ # 14 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006
Visual Binary - 29 May 2008 08:42 AM

Not sure why the direct link isn’t working for you (it works for me).  But for the google.load() method, you’re not appending your Google API Key to the end of the source URI.  That’s needed for that method to work.

Read the developer’s guide.  You can get your API key here.

Well no actually the direct link does work fine but I’m pretty sure that you don’t get the zipped and minified versions if you do it in that way which is what I was looking for.

With reference to the google.load part I did actually place my API key in there as yes it does require it, sorry forgot to mention I had done that when I posted the code that I did above. Had copied that code directly from their site documentation but did see buried away on another page somewhere that to use the AJAX APIs you needed to specify the API key so have done that too.

All that isn’t working for me is the API google.load part. I can get a direct file to load with no problems but I’m pretty sure that I read on their (Google) site that if you do this then you don’t get the benefit of the zipped and minified code-bases?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 May 2008 09:50 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  368
Joined  02-26-2008
Mark Bowen - 29 May 2008 09:32 AM

All that isn’t working for me is the API google.load part. I can get a direct file to load with no problems but I’m pretty sure that I read on their (Google) site that if you do this then you don’t get the benefit of the zipped and minified code-bases?

Hmm…you can link directly to the minified version.  Just link to

http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js

Use whatever version number you want.  Currently only 1.2.3 and 1.2.6 are hosted at Google.  More information here.

As Ingmar has posted, there is no difference between using google.load() and linking directly.

Profile
 
 
Posted: 29 May 2008 09:56 AM   [ Ignore ]   [ # 16 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Hiya,

I’m pretty certain that I read on the Google site that if you use the direct link method then you don’t get all the added bells and whistles such as GZipped files (if the browser supports it) and also the minified scripts?

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 May 2008 06:53 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  137
Joined  12-24-2007

Each library is available via both google.load(), and directly via tag. The google.load() approach offers the most functionality and performance. In the sections that follow, we document all of the libraries that are available. For each library we list it’s name (as in the name used in google.load(), all of the versions that we have on hand for the library, etc.

Source: http://code.google.com/apis/ajaxlibs/documentation/

They don’t really elaborate as to why.

 Signature 

Trifecta Interactive Marketing | Austin, TX

Profile
 
 
Posted: 29 May 2008 11:16 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  814
Joined  02-28-2006

Hey hey, time to join another users group.

 Signature 

Wee-kee- dee-kee!
Who’s that drivin’ the bus -next stop the weekend!
™T.Gee. (Q n’ A -w/ way more Q’s than A’s) wink

Profile
 
 
   
 
 
‹‹ Going Green!      recommend a CRM? ››
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64908 Total Logged-in Users: 36
Total Topics: 81852 Total Anonymous Users: 31
Total Replies: 440056 Total Guests: 221
Total Posts: 521908    
Members ( View Memberlist )