The support for these features is included in the API for additional flexibility. How you implement the API on your site and in your application will depend very much on what you're trying to do. If you have a page that depends on the Feeds API, you will want to use the jsapi by including it via a remote script tag, right in the page. If you have a page that doesn't need the API right immediately, or you want to load other primary content faster, you can use the jsapi? callback= method to load the script asynchronously. The autoload params can dramatically clean up your code. And the list goes on and on. Usually, when I load the api for a general page, I do it like this:
<script type="text/javascript" src="http://www.google.com/jsapi"></ script> <script type="text/javascript"> google.load(...); // the apis I want to load function init(){ // what I want to do onload } google.setOnLoadCallback(init); </script> Jeremy R. Geerdes Effective website design & development Des Moines, IA For more information or a project quote: http://jgeerdes.home.mchsi.com http://jgeerdes.blogspot.com http://jgeerdes.wordpress.com [email protected] Unless otherwise noted, any price quotes contained within this communication are given in US dollars. If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church! And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com ! On May 12, 2009, at 6:20 PM, snowcavalier wrote: > > Just to clarify: > > By dynamic loading i mean dynamically creating a script to jsapi. > By autoloading i mean including the api (in my case the feeds api) as > a parameter to jsapi to eliminate an additional load. > > > It seems there are two different ways to do the callback. > 1) You can specify a callback as its own parameter to jsapi (like > "&callback=googleAPILoaded"). > 2) You can also specify a callback inside the autoloading of the feeds > api by url encoding "{"callback" : feedAPILoaded}" > > Is there a best or proper way to do this? Is it certain that the feed > api will be loaded in both cases? I'm tempted to use the second. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-AJAX-Search-API?hl=en -~----------~----~----~----~------~----~------~--~---
