i have google ajax search and now i want to add adsense to it. Can
someone please help ? I have added as follows but it does not seems
to work.
function onLoadGSearch() {
var options = {
adsOptions: {
client: 'pub-0224090403306930',
adsafe: 'high', // safe ads
language: 'en'
}
};
var searchControl = new google.search.SearchControl();
var drawOptions = new google.search.DrawOptions();
var webSearch = new google.search.WebSearch(options);
webSearch.setUserDefinedLabel("My Web");
webSearch.setUserDefinedClassSuffix("webSearch");
webSearch.setSiteRestriction("
jigarshah.net");
searchControl.addSearcher(webSearch);
var siteSearch = new google.search.WebSearch(options);
siteSearch.setUserDefinedLabel("My Blog");
siteSearch.setUserDefinedClassSuffix("siteSearch");
siteSearch.setSiteRestriction("
jigarashah.blogspot.com");
searchControl.addSearcher(siteSearch);
drawOptions.setDrawMode
(google.search.SearchControl.DRAW_MODE_LINEAR);
// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("searchControl"),
drawOptions);
// Execute an inital search
searchControl.execute("");
}