Adding a delay to execute("...") appears to work around this problem.
Though obviously this trick makes the query slower and it's not
reliable as it depends on how quickly the user can load the page.
Example:
google.load('search', '1', {language : 'en'});
google.setOnLoadCallback(function () {
/* Typical code sample for a CSE */
var customSearchControl = new google.search.CustomSearchControl
('partner-pub-***************************************');
customSearchControl.setResultSetSize
(google.search.Search.LARGE_RESULTSET);
var options = new google.search.DrawOptions();
options.setSearchFormRoot('cse-search-form');
customSearchControl.draw('cse', options);
/* The following is the workaround */
setTimeout(function () {
customSearchControl.execute("test");
}, 1000);
}, true);
Can someone from Google comfirm if this is a bug or we're all doing
something wrong?
Thanks,
Sebastiaan
On Nov 21, 11:04 am, Dusty <[email protected]> wrote:
> I am the the USA. I am having the same problem. The search works fine
> with manual input, but when using the .executefunction it will not
> displayAdSenseon thefirstexecution.
>
> Any solutions found yet? I have exhaustively searched the web and read
> over the documentation.
>
> Thanks,
> D.
--
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.