Thanks, will give it a go!

On Jun 29, 9:39 am, Jeremy Geerdes <[email protected]> wrote:
> Move the following code up above the line reading "function Google(){"
>
> google.load("search","1",{"nocss":true,"nooldnames":true});
>
> Further, you need to make sure that Google (the function) is not  
> called until AFTER the page finishes loading (you may be doing this  
> already, but without the complete code, I can't tell).
>
> The problem is that the google.load call loads a new script element  
> from Google which must be returned and run before you can call  
> anything against google.search.  There's just no time for that to  
> happen with the code as you have it.
>
> You might also beware of the $("searchcontrol") call in your  
> searchControl.draw statement.  Assuming this is a JQuery call, I don't  
> think it will return the actual element, but the JQuery object which  
> represents the element. You probably need something like $
> ("searchcontrol")[0].
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project 
> quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://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, 
> athttp://jgeerdes.blogspot.com
>   !
>
> On Jun 29, 2009, at 7:39 AM, Leonard Begy wrote:
>
>
>
> > I have loaded the api script,
> > <script type="text/javascript" src="http://www.google.com/jsapi?
> > key=xyzzy"></script>
>
> > I have provided a container for the search control;
> > <div id="searchcontrol">Loading...</div>
>
> > After the page is loaded I call the loader function;
> > Google();
>
> > This is the function;
> > function Google() {
> >    google.load("search", "1",{
> >    "nocss" : true,
> >    "nooldnames" : true
> >    });
> >    var searchControl = new google.search.SearchControl();
> >    searchControl.draw($("searchcontrol"));
> > }
> > firefbug returns the error;
> > 'google.search is undefined'
>
> > Could it be that the script request is cross domain?
>
> > What am I doing wrong/
--~--~---------~--~----~------------~-------~--~----~
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