为你的blog添加搜索功能
2006-09-18 21:33
411 查看
csdn中的blog本身没有提供搜索功能,但我们可以使用google来进行搜索。
具体的办法是将下面的代码添加到公告里面。
<SCRIPT type=text/javascript>
<!--
function myclick() {
window.open("http://www.google.com/search?as_sitesearch=http://blog.csdn.net/fengfangfang&as_q=" + getObject("as_q").value );
}
// -->
</SCRIPT>
<font size=1>
<input type="text" name="as_q" size="10" ID="as_q">
<input type="button" name="btnG" value="搜索" onclick="myclick();">
</font>
其中的 http://blog.csdn.net/fengfangfang 改成你自己的blog地址。其中的getObject函数是CSDN的blog自带的,其代码如下(不必加到公告里):
function getObject(objectId)
{
if(document.getElementById)
{
return document.getElementById(objectId)
}
else if(document.all&&document.all(objectId))
{
return document.all(objectId)
}
else
{
return false
}
}
具体的办法是将下面的代码添加到公告里面。
<SCRIPT type=text/javascript>
<!--
function myclick() {
window.open("http://www.google.com/search?as_sitesearch=http://blog.csdn.net/fengfangfang&as_q=" + getObject("as_q").value );
}
// -->
</SCRIPT>
<font size=1>
<input type="text" name="as_q" size="10" ID="as_q">
<input type="button" name="btnG" value="搜索" onclick="myclick();">
</font>
其中的 http://blog.csdn.net/fengfangfang 改成你自己的blog地址。其中的getObject函数是CSDN的blog自带的,其代码如下(不必加到公告里):
function getObject(objectId)
{
if(document.getElementById)
{
return document.getElementById(objectId)
}
else if(document.all&&document.all(objectId))
{
return document.all(objectId)
}
else
{
return false
}
}
相关文章推荐
- 为你的blog添加搜索功能
- 为你的Blog添加天气预报,Google搜索
- [转改]为你的 Blog 添加“天气预报”功能。
- 为你的 Blog 添加“天气预报”功能。
- 为你的 Blog 添加“天气预报”功能。
- 为你的blog添加选中翻译的功能
- [zt]为你的 Blog 添加“天气预报”功能。
- 为你的 Blog 添加“天气预报”功能。
- 二十五、为你的网站添加强大的搜索功能
- 为你的 Blog 添加“状态栏文本”功能。
- 为你的 Blog 添加“跟随鼠标的文字”功能。
- 谷歌官方欲将AMP功能添加到移动搜索结果中
- ActionBar上添加搜索功能
- 如何在生成CHM文件中添加搜索功能
- 为blog添加天气预报功能
- 此blog 是不是还应该有个搜索功能?
- 请教:blog上的搜索功能是不是不能用啊?我怎么什么都搜不出来?
- 推荐几个提高访问量的博客插件:为你的博客添加分享按钮、智能关联推荐功能
- lucene3.6笔记添加搜索功能
- 如何给自己的blog添加功能