Live Chat & Podcast at 1:00PM Eastern on Sunday!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Tag Cloud
access acer asus bios bsod computer crash desktop driver drivers error ethernet excel freeze gaming hard drive hardware hdmi internet laptop malware memory modem monitor motherboard network printer problem ram registry router security slow software sound toshiba trojan ubuntu 11.10 uninstall usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Google serach is not working in my web site

Reply  
Thread Tools
prashant07's Avatar
Junior Member with 1 posts.
 
Join Date: Nov 2009
Experience: Intermediate
17-Nov-2009, 05:06 AM #1
Google serach is not working in my web site
I have a problem with the Google search (insite search) implemented on one of our clients site (www.morrisfoundation.in)
We have hosted this site on godaddy server. The issue which we are facing is as below:

The Google custom search (insite search) we have implemented on the website returns no results every time or any time on any keyword search on the site. The keywords which you could use for your reference could be like - ADD, Morris, Training program, etc.

I have use the following code..

<script type="text/javascript"
src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAAsAzZfunLIuitazLi7gywyhQwHkkBoUQGHi5pswjo0-XzJ3Td0RTBhkZRvX_LHHu8TYKWpoQPhdeuMg">
</script>
<script language="Javascript" type="text/javascript">
//<![CDATA[

google.load("search", "1");

function OnLoad() {
// Create a search control
var searchControl = new GSearchControl();
searchControl.setResultSetSize(GSearch.LARGE_RESULTSET);


// site restricted web search with custom label
// and class suffix
var options = new GsearcherOptions();
var siteSearch = new GwebSearch();
siteSearch.setUserDefinedLabel("Search results for Morrisfoundation");
siteSearch.setUserDefinedClassSuffix("siteSearch");
siteSearch.setSiteRestriction("morrisfoundation.in");

searchControl.addSearcher(siteSearch, options);
options.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);


//to get the id from querystring
//Server.UrlDecode(Convert.ToString(Request.QueryString["Search"]))
var tabvalue = getQueryVariable("Search");
tabvalue=tabvalue.replace(/%20/g," ");


document.getElementById("searchcontrol").value=tabvalue;


searchControl.draw(document.getElementById("searchcontrol"));

// Execute an inital search
searchControl.execute(document.getElementById("searchcontrol").value);
}
google.setOnLoadCallback(OnLoad);

function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
//var vars = query.split("&");
var vars = query.split(" ");
for (var i=0;i<vars.length;i++)
{
var pair = vars[i].split("=");
if (pair[0] == variable)
{
return pair[1];
}
}
}
//]]>
</script>

Could you please help on above mentioned problem ASAP
eberlysystems's Avatar
Computer Specs
Member with 286 posts.
 
Join Date: Nov 2009
Location: Reading, PA
Experience: Advanced
29-Nov-2009, 10:33 PM #2
Where is this code from? Did you get it from Google's "Webmaster Tools"? I'm not a javascript pro by any stretch, but I do know that all of my Google Custom Search iterations are quite a bit simpler. So - where did it come from?
Reply

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:11 PM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.