Many thanks, Jeremy! Adding a callback function has indeed solved my
problem.

Looking at the docs (http://code.google.com/apis/ajax/documentation/
#Dynamic) again, it does mention adding a callback function, but it's
not entirely clear (at least not to me) that this is required for it
to work properly. Maybe the docs should mention that adding a callback
means that the function uses DHTML instead of document.write. It would
have been of great help to me, since I was quite sure that the problem
was caused by a document.write call, but I didn't know how to turn it
off.

Anyway, thanks again for your quick response, Jeremy!

On Feb 16, 6:25 pm, Jeremy Geerdes <[email protected]> wrote:
> 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 
> > athttp://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.

Reply via email to