Welcome to TechNet Blogs Sign in | Join | Help

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: 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>

Published Tuesday, January 18, 2005 4:15 PM by evand

Comments

# re: Search Evan's Blog

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 :)
Thursday, January 20, 2005 4:42 AM by David Cumps

# re: Search Evan's Blog

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
Thursday, January 20, 2005 4:43 AM by David Cumps

# re: Search Evan's Blog

Nice coding Evan. I use the Technorati searchlet. Did you try that?
Sunday, January 30, 2005 4:08 AM by Luc Geurts

# MSN Search for blogs

Friday, February 04, 2005 11:27 AM by Eileen Brown's WebLog

# MSN Search for blogs

Friday, February 04, 2005 11:41 AM by Eileen Brown's WebLog

# MSN Search now available for Barnaby's Canadian IT Pro WebLog

Monday, February 07, 2005 2:48 PM by Barnaby's Canadian IT Pro WebLog
New Comments to this post are disabled
 
Page view tracker