Search Evan's Blog
Seems like everyone’s doing it, so I suppose I should too.
I’ve added a search option to the blog, using roughly the sample code David Cumps posted a few days ago: https://weblogs.asp.net/cumpsd/archive/2005/01/11/350909.aspx.
Updated (some folks asked me what “roughly the sample code” means). I actually switched it up to use the https://search.msn.com site is all. Here’s my modified code — change the stuff in Red for your specific application:
<h3>Search Evan's Blog <img src="https://search.msn.com/s/affillogo.gif" border="0" ALT="MSN Search"/> </h3>
<input class="BlogSearch" type="text" name="searchBox" id="blogSearchTextMSN" value="" onkeypress="return blogSearchMSN(event, this);">
<input type="button" value="Search" onclick="return blogSearchMSN2('blogSearchTextMSN');" class="BlogSearchButton">
<script type="text/javascript">
function blogSearchMSN(event, oInput) {
var keyCode = (event) ? event.keyCode : keyStroke.which;
if (keyCode == 13) {
top.location = 'https://search.msn.com/results.aspx?q=' + escape(oInput.value) + '%20site%3Ablogs.msdn.com%20evand&FORM=QBRE';
return false;
} return true;
}
function blogSearchMSN2(oInputId) {
var oInput = document.getElementById(oInputId);
top.location = 'https://search.msn.com/results.aspx?q=' + escape(oInput.value) + '%20site%3Ablogs.msdn.com%20evand&FORM=QBRE';
return false;
}
</script>
Comments
- Anonymous
January 20, 2005
Other info: I added an important notice to the post about Google terms and rumours about sites being removed from the index, please check it out and decide for yourself :) - Anonymous
January 20, 2005
Oops, I was too fast, apparently you don't have the Google version :p but it might be worth to check if MSN doesn't have any of those (annoying) rules - Anonymous
January 30, 2005
Nice coding Evan. I use the Technorati searchlet. Did you try that?