Hi guys
I'm after some help trying to set up my “google site search” for my
website. I am using the following code to make use of the API which
works fine:
function OnLoad() {
new CSEOverlay("005225586522549267618:bc6jsjymafe",
document.getElementById("site_search"),
document.getElementById("results"));
}
google.setOnLoadCallback(OnLoad);
This code is provided by Google.
However: I don't want to use an overlay I simply want to specify the
site search (site_search) and the results (results) so that it can
just target a div on my page and I dont have to work about all the
over lay stuff. Its just overkill.
I cant get it to work for the life in me. Ive read all the
documentation, but surely I must be missing something. I'm pulling my
hair out, and really don't want to resolve to using the iframe method.
If anyone could help It would be hugely appreciated.
I'm sure I need to go down this route:
function OnLoad() {
// create a search control
var searchControl = new google.search.SearchControl();
// create a draw options object so that we
// can position the search form root
var options = new google.search.DrawOptions();
options.setSearchFormRoot(document.getElementById
("site_search"));
// populate with searchers
// pull my own search results in here somehow
searchControl.draw(document.getElementById("results"),
options);
searchControl.execute("Test");
}
google.setOnLoadCallback(OnLoad, true);
//]]>
</script>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---