一路小跑 | Jerry's Blog

诚信 善良 谦逊 勤勉 执着

  DonewsBlog  |  Donews首页  |  Donews社区  |  Donews邮箱  |  我的首页  |  联系作者  |  聚合   |  登录
  182篇文章 :: 22篇收藏:: 115篇评论:: 20个Trackbacks

公告


搜索本站

文章

收藏

相册

朋友的连接

搜索引擎

推荐连接

自己的连接

存档


正在读取评论……


2006年04月


哎!不幸中招了




AjaxWhois.com - instant domain name lookup and Whois
常在万网查域名,翻来翻去很麻烦。
偶然发现这个网站,自动就查询了,一个页面把大部分工作都做了,这才叫用户体验!
 
你也试试:http://ajaxwhois.com/



想在我的Blog上放一个Google的搜索条,首先想到的是从别人那里移植,没有成功,算了,搁置了很久。
今天晚上心血来潮,决定自己来解决这个问题。
于是写了如下代码:

<input type=text id=kw><br>
<button onclick="return SouSuo(document.getElementById('kw').value);">Google</button>
<input type=checkbox id=ThisSite>搜索本站<br>
<script type="text/javascript">
function SouSuo(kw)
{
if(kw=='')
{alert('请输入关键词!');document.getElementById('kw').focus();return false;}
else kw=kw.replace(' ','+');
preurl='http://www.google.com/search?hl=ZH-cn&q=';
thissite='site:blog.donews.com/xrun+';
if(document.getElementById('ThisSite').checked==true)
{url=preurl+thissite+kw;}
else url=preurl+kw;
window.open(url);
}
</script>

算法也许土了点,但是还算比较好使,呵呵。