Evan Dodds - Microsoft Exchange Server Blog

Exchange, Exchange administration stuff, and other assorted ramblings

Blogs

Search Evan's Blog

  • Comments 6
  • Likes

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: http://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 http://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="http://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 = 'http://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 = 'http://search.msn.com/results.aspx?q=' + escape(oInput.value) + '%20site%3Ablogs.msdn.com%20evand&FORM=QBRE';
  return false;
}
</script>

Comments
  • 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 :)

  • 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

  • Nice coding Evan. I use the Technorati searchlet. Did you try that?