Add a Google AJAX Search to your Blog. ~ The Blog Doctor.
Loading...

Add a Google AJAX Search to your Blog.

New Visitor? Like what you read? Then please subscribe to my Blog Feed or sign up for Free Email Updates. Thanks for Visiting!

To add a Google AJAX Search to your Blog go to.............

http://code.google.com/apis/ajaxsearch/ and get a Google AJAX Search API key. Click on
Sign up for a Google AJAX Search API key button and you will be taken to this page:
http://code.google.com/apis/ajaxsearch/signup.html. Put a check in the box where it says I have read and agree with the terms and conditions and paste your blog url in the textbox below and click on Generate API Key button.

Your API Key and code is generated. Paste this code (blue lines only) :

<link href="http://www.google.com/uds/css/gsearch.css" type="text/css" rel="stylesheet"/>

<script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=YOUR API KEY CODE HERE" type="text/javascript">
IN THE ABOVE LINE ADD amp; AFTER BOTH THE & CHARACTERS OR YOU WILL GET ERROR MESSAGE.
</script>
<script language="Javascript" type="text/javascript">
//<![CDATA[

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

// Add in a full set of searchers
var localSearch = new GlocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new GwebSearch());
searchControl.addSearcher(new GvideoSearch());
searchControl.addSearcher(new GblogSearch());

// Set the Local Search center point
localSearch.setCenterPoint("New York, NY");

// Tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("searchcontrol"));

// Execute an inital search
searchControl.execute("Google");
}

//]]>
</script>

in your template just after the title tags and save. Type in your Google API key code where it says 'YOUR API KEY CODE HERE' above.



Then paste this code inyour template just after <body> tag :

<body onload="OnLoad()">
<div id="searchcontrol"/>
</body>

and Save.



Paste this code in the css part of your template :

#searchcontrol {
float:right;
margin-right: 95px;
}



See how I have added it to my test site :http://testbetatemplate.blogspot.com/
Click on image below for larger view.





IMPORTANT : It is necessary to have an empty space in the right hand part of the body of your template to add this in the way I have done.


Technorati Tags:,

0 comments:

CLICK TO LEAVE A COMMENT..... :-)



Skip to top of post.

Search Blog Before Commenting

Loading...

Post a Comment

Please use the above search box to search this blog before posting your valuable comments.

Comments posted on Dummies Guide to Google Blogger (Beta) are moderated and will be approved only if they are on-topic and not abusive. Try not to include website URLs/links in your comments. You can email me : drbhatns at gmail dot com for any blogging question. Thanks,

Vin.

The Blog Doctor The Blog Doctor2 Blog Doctor Home

SUGGESTED READING

Tips On Blogger and Latest News.



Skip to top of post.