bah, thank you for pointing that out, added a simple else statement to do what I wanted to do and it works great, I was just getting to hung up on why the method wasn't working On Nov 23, 12:51 pm, Jeremy Geerdes <[email protected]> wrote: > .setNoResultsString() is a method of the default SearchControl . Since > you're using a customRawSearchControl, you'll have to define the > method for yourself. > > 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 Nov 23, 2009, at 10:33 AM, [email protected] wrote: > > > > > Hi everyone, > > > When I try to use .setResultsString I get an error. The error is > > telling me the object doesn't support this property or method. Any > > help is appreciated :) > > > <script src="http://www.google.com/jsapi" type="text/javascript"></ > > script> > > > <script type="text/javascript">//<![CDATA[ > > google.load('search','1'); > > > function OnLoad() { > > > var hotelinfosearcher=new google.search.WebSearch; > > var competingsearcher=new google.search.WebSearch; > > > window.hotelinfosearch = newRawSearchControl("results", "cursor", > > hotelinfosearcher); > > window.competingsearch = newRawSearchControl("competingresults", > > "competingcursor", competingsearcher); > > > } > > > functionRawSearchControl(results, cursor, searcher) { > > > this.results = document.getElementById(results); > > this.cursor = document.getElementById(cursor); > > > this.activeSearcher = "web"; > > > // wire up a raw GwebSearch searcher > > searcher = new google.search.WebSearch(); > > > searcher.setResultSetSize(google.search.Search.LARGE_RESULTSET); > > searcher.setNoResultsString("No Results"); > > > searcher.setNoHtmlGeneration(); > > //searcher.setNoResultsString(); > > > searcher.setSearchCompleteCallback(this, > > >RawSearchControl.prototype.searchComplete, > > [searcher] > > ); > > this.searchers=[]; > > this.searchers["web"] = searcher; > > > } > > > RawSearchControl.prototype.searchComplete = function(searcher) { > > > // always clear old from the page > > this.clearResults(); > > > // if the searcher has results then process them > > if (searcher.results && searcher.results.length > 0) { > > > for (var i=0; i<searcher.results.length; i++) { > > > var result = searcher.results[i]; > > var titleLine > > > if(this.results == document.getElementById("results")) { > > > if( searchtext(result.unescapedUrl + "&", "propertyID=", > > "&" ) != "XXXerrorXXX") { > > > titleLine = result.titleNoFormatting + searchtext > > (result.unescapedUrl + "&", "propertyID=", "&" ) ; > > > } > > > } > > else > > { > > > titleLine = "<a href=" + result.unescapedUrl + " > > target='competingiframe'>" + result.titleNoFormatting + "</a><br>" > > +result.content > > > } > > div = createDiv(titleLine); > > > this.results.appendChild(div); > > } > > > if (searcher.cursor) { > > var cursorNode = createDiv(null, "gsc-cursor"); > > for (var i=0; i<searcher.cursor.pages.length; i++) { > > var className = "gsc-cursor-page"; > > if (i == searcher.cursor.currentPageIndex) { > > className = className + " gsc-cursor-current-page"; > > } > > var pageNode = createDiv(searcher.cursor.pages[i].label, > > className); > > pageNode.onclick = methodClosure(this, this.gotoPage, > > [searcher, i]); > > cursorNode.appendChild(pageNode); > > } > > this.cursor.appendChild(cursorNode); > > > } > > > } > > } > > RawSearchControl.prototype.searchg = function(form, domain){ > > for(var z in this.searchers){ > > this.searchers[z].execute(form + domain); > > } > > > } > > > RawSearchControl.prototype.gotoPage = function(searcher, page) { > > searcher.gotoPage(page); > > } > > > /** > > * clearResults - clear out any old search results > > */ > > RawSearchControl.prototype.clearResults = function() { > > > removeChildren(this.results); > > removeChildren(this.cursor); > > } > > > /** > > * Static DOM Helper Functions > > */ > > function removeChildren(parent) { > > while (parent.firstChild) { > > parent.removeChild(parent.firstChild); > > } > > } > > function createDiv(opt_text, opt_className) { > > var el = document.createElement("div"); > > if (opt_text) { > > el.innerHTML = opt_text; > > } > > if (opt_className) { el.className = opt_className; } > > return el; > > } > > > function methodClosure(object, method, opt_argArray) { > > return function() { > > return method.apply(object, opt_argArray); > > } > > } > > > function createLink(href, opt_text, opt_target, opt_className, > > opt_divwrap) { > > var el = document.createElement("a"); > > el.href = href; > > if (opt_text) { > > el.innerHTML = opt_text; > > } > > if (opt_className) { > > el.className = opt_className; > > } > > if (opt_target) { > > el.target = opt_target; > > } > > if (opt_divwrap) { > > var div = this.createDiv(null, opt_className); > > div.appendChild(el); > > el = div; > > } > > return el; > > } > > > // register to be called at OnLoad when the page loads > > 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 > > athttp://groups.google.com/group/google-ajax-search-api?hl= > > .- Hide quoted text - > > - Show quoted text -
-- 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=.
