You need to utilize the callback option, as below:
google.load('search','1',{ callback : callbackFunction })
When you do that, two things will happen. First, the loader will use DHTML to
add the necessary script elements to the page instead of document.write, so
your page won't go blank all of a sudden. And second, it will call
callbackFunction when the API is loaded so that you can continue your script in
callbackFunction.
Jeremy R. Geerdes
Effective website design & development
Des Moines, IA
For more information or a project quote:
http://jgeerdes.home.mchsi.com
[email protected]
If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!
On Feb 16, 2010, at 11:18 AM, MrM wrote:
> Hi,
>
> When I call the google.load function from inline javascript,
> everything works fine. However, if I try to call it from somewhere
> else (like the jQuery ready event or the firebug console), it
> redirects me away from the current page and keeps on loading
> indefinitely.
>
> This is the browser I'm testing on:
> Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.17) Gecko/2010010604
> Ubuntu/9.04 (jaunty) Firefox/3.0.17 (.NET CLR 3.5.30729)
>
> What am I doing wrong? Am I missing something obvious here? I've been
> trying to solve this problem for days now, so any help would be
> greatly appreciated.
>
> Thanks!
>
> --
> 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.
>
--
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.