ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Google AJAX API (was: CodeIgniter AJAX With jQuery)

May 28, 2008 6:00am

Subscribe [5]
  • #1 / May 28, 2008 6:00am

    Ingmar

    29245 posts

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

  • #2 / May 28, 2008 10:31am

    Crssp-ee

    572 posts

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

  • #3 / May 28, 2008 10:38am

    Ingmar

    29245 posts

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

  • #4 / May 28, 2008 10:41am

    Crssp-ee

    572 posts

    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.

  • #5 / May 28, 2008 11:11am

    Ingmar

    29245 posts

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

  • #6 / May 28, 2008 11:12pm

    trif3cta

    148 posts

    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.

  • #7 / May 29, 2008 6:04am

    Mark Bowen

    12637 posts

    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

  • #8 / May 29, 2008 6:13am

    Ingmar

    29245 posts

    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>
  • #9 / May 29, 2008 6:28am

    Mark Bowen

    12637 posts

    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

  • #10 / May 29, 2008 10:13am

    Crssp-ee

    572 posts

    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.

  • #11 / May 29, 2008 10:31am

    Ingmar

    29245 posts

    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.

  • #12 / May 29, 2008 10:37am

    Mark Bowen

    12637 posts

    Still can’t get it to work though unfortunately 😉

    Best wishes,

    Mark

  • #13 / May 29, 2008 11:42am

    Arun S.

    792 posts

    Still can’t get it to work though unfortunately 😉

    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.

  • #14 / May 29, 2008 11:53am

    Crssp-ee

    572 posts

    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.

  • #15 / May 29, 2008 12:32pm

    Mark Bowen

    12637 posts

    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

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases