I could be wrong, but I'm pretty sure this is because of the way the SearchControl is designed. Namely, when you call the control's draw method, it will override a number of the settings that you've set on the individual searcher(s). Link target, I believe, is one of them. The way to workaround this is to use the control's setLinkTarget method instead of the searcher's. In other words, replace the line reading like this:
localSearch.setLinkTarget(google.search.Search.LINK_TARGET_BLANK); with this: searchControl.setLinkTarget(google.search.Search.LINK_TARGET_BLANK); Jeremy R. Geerdes Effective website design & development Des Moines, IA For more information or a project quote: http://jgeerdes.home.mchsi.com http://jgeerdes.blogspot.com http://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, at http://jgeerdes.blogspot.com ! On Sep 4, 2009, at 4:54 AM, duxbuz wrote: > > Hi > > Am just trying to set up a basic search on webpage. > > I have currently been using some code from HelloWorld example. > > My issue is the line containing -- localSearch.setLinkTarget > (google.search.Search.LINK_TARGET_BLANK); > > it doews not seem to open results in blank window. > > Anyone help? > > Thanks. > > ======== example ======== > > google.load('search', '1'); > > function OnLoad() { > // Create a search control > var searchControl = new google.search.SearchControl(); > > // Add in a full set of searchers > var localSearch = new google.search.LocalSearch(); > searchControl.addSearcher(localSearch); > searchControl.addSearcher(new google.search.WebSearch()); > searchControl.addSearcher(new google.search.VideoSearch()); > searchControl.addSearcher(new google.search.BlogSearch()); > searchControl.addSearcher(new google.search.NewsSearch()); > searchControl.addSearcher(new google.search.ImageSearch()); > searchControl.addSearcher(new google.search.BookSearch()); > searchControl.addSearcher(new google.search.PatentSearch()); > > // Set the Local Search center point > localSearch.setCenterPoint("New York, NY"); > > // new window?? > localSearch.setLinkTarget(google.search.Search.LINK_TARGET_BLANK); > > // tell the searcher to draw itself and tell it where to attach > searchControl.draw(document.getElementById("cse")); > > // execute an inital search > searchControl.execute("VW GTI"); > } > > google.setOnLoadCallback(OnLoad); > </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 -~----------~----~----~----~------~----~------~--~---
