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>