atom feed9 messages in com.googlegroups.google-ajax-search-apiUsing the titleNoFormatting value
FromSent OnAttachments
Stephen NixonApr 30, 2009 11:11 pm 
Jeremy GeerdesMay 1, 2009 4:51 am 
Stephen NixonMay 3, 2009 4:51 pm 
Stephen NixonMay 3, 2009 5:37 pm 
Jeremy GeerdesMay 3, 2009 7:07 pm 
Stephen NixonMay 3, 2009 9:07 pm 
Jeremy GeerdesMay 3, 2009 9:13 pm 
Stephen NixonMay 3, 2009 9:39 pm 
Jeremy GeerdesMay 3, 2009 9:41 pm 
Subject:Using the titleNoFormatting value
From:Stephen Nixon (sten@googlemail.com)
Date:Apr 30, 2009 11:11:47 pm
List:com.googlegroups.google-ajax-search-api

Hi there, I'm trying to show the title of the results with no formatting in my results, but no luck so far. I've looked at old posts and think that I need to utilise the setSearchCompleteCallback method. this is what I've tried so far, but I'm still getting the bold <b> in my results.

Here's what I have so far. If someone can give me a pointer that'd be great. Thanks

function OnLoad() { // Create a search control var searchControl = new google.search.SearchControl(); // Add in a WebSearch var webSearch = new google.search.WebSearch(); var options = new google.search.SearcherOptions(); options.setExpandMode (google.search.SearchControl.EXPAND_MODE_OPEN); // Add the searcher to the SearchControl searchControl.addSearcher(webSearch, options); // Set the target to override the default of '_blank' searchControl.setLinkTarget (google.search.Search.LINK_TARGET_SELF); searchControl.setResultSetSize (google.search.Search.LARGE_RESULTSET); // tell the searcher to draw itself and tell it where to attach searchControl.draw(document.getElementById("content")); // execute an inital search var searchTerms = getParameter(queryString, 'searchInput'); if ( searchTerms != 'null' ) { searchControl.execute(searchTerms); } searchControl.setSearchCompleteCallback(this, OnSearchComplete); }

OnSearchComplete = function(sc, searcher) { if ( searcher.results && searcher.results.length > 0) { for (var i = 0; i < searcher.results.length; i++) { var result = searcher.results[i]; result.title = result.titleNoFormatting; } } } google.setOnLoadCallback(OnLoad);