RubyPdf 的中文博客
专注PDF技术
博客园
首页
新随笔
订阅
管理
posts - 194, comments - 1484, trackbacks - 6
在博客页首添加搜索功能
把博客园的搜索设置移植到了页面顶端,这样让博客的搜索功能更加醒目。
同时整合了“Adsense for Search” 以及“Add related keyword links”(添加相关关键字链接,起到搜索提示的功能)。
下面是我使用的代码:
<
script
language
="JavaScript"
>
function
SearchGoogle(key,evt,site)
{
if
(evt.keyCode
==
13
||
evt.keyCode
==
0
||
evt.type
==
'
click
'
)
{
key.focus();
var
keystr
=
encodeURIComponent(key.value);
url
=
"
http://www.google.com/search?q=
"
;
url
=
url
+
keystr;
url
+=
"
&client=pub-7558339387099421&forid=1&ie=UTF-8&oe=UTF-8&safe=active&cof=GALT%3A%23008000%3BGL%3A1%3BDIV%3A%23336699%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AFFFFFF%3BLBGC%3A336699%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BFORID%3A1&hl=zh-CN&x=0&y=0&domains=
"
+
site
+
"
&sitesearch=
"
+
site;
window.location
=
url;
return
false
;
}
}
</
script
>
<
table
><
tr
><
td
>
<
input
style
="WIDTH: 130px"
type
="text"
name
="q"
id
="q"
onkeydown
="return SearchGoogle(document.getElementById('q'),event,'http://www.cnblogs.com/hardrock/')"
>
<
input
onclick
="SearchGoogle(document.getElementById('q'),event,'http://www.cnblogs.com/hardrock/')"
type
="button"
value
="搜索"
name
="sa"
>
</
td
><
td
>
<
script
type
="text/javascript"
>
<!--
google_ad_client
=
"
pub-7558339387099421
"
;
google_ad_format
=
"
350x30_sdo
"
;
google_link_target
=
2
;
google_color_bg
=
"
ffffff
"
;
google_color_link
=
"
black
"
;
google_encoding
=
"
UTF-8
"
;
//
-->
</
script
>
<
script
type
="text/javascript"
src
="http://pagead2.googlesyndication.com/pagead/show_ads.js"
>
</
script
>
</
td
></
tr
></
table
>
标签:
Google Search
,
Adsense
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted on 2008-01-26 14:22
RubyPDF
阅读(405)
评论(1)
编辑
收藏
FeedBack:
1054474
#1楼
2008-01-26 19:10
|
学习学习了[未注册用户]
很不错
回复
引用
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
最想要的Entity Framework功能
·
专访Jeffrey Richter:Windows 8是微软的重中之重
·
《福布斯》:谷歌进军硬件产品 难撼动苹果地位
·
美国空军拟最多购买1.8万台iPad 2
·
分析称专利之争让谷歌苹果两败俱伤
»
更多新闻...
最新知识库文章
:
·
高级编程语言的发展历程
·
如何学习一门新的编程语言?
·
学习不同编程语言的重要性
·
为什么我喜欢富于表达性的编程语言
·
计算机专业的女生为什么要学编程
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
<
2008年1月
>
日
一
二
三
四
五
六
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
RubyPDF Blog
RubyPDF Software
e类出版论坛(EPUBCN)
C#新型报表工具 XDesigner
昵称:
RubyPDF
园龄:
6年5个月
粉丝:
18
关注:
3
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
最新随笔
1. content-disposition attachment filename 在Firefox和IE中得到不同的结果
2. Google Voice开始发送邀请函
3. ASP.NET空间使用SQLite遇到的麻烦
4. PDF数字签名免安装版本发布-Portable PDF Digital Signature(Portable PDF Signer)
5. Dreamhost 开始提供免费空间了
6. SQLite Manager
7. Sqlite使用中的几点体会。
8. Thinkpad T60 Fan Error及重新启动windows后画面静止
9. PdfCrypt 1.0 for Windows 发布
10. XMP Remover:批量删除PDF 文档的XMP data
我的标签
Free ASP.NET 2.0 Hosting
(3)
MS Sql Server Express 2005
(3)
Google Search
(1)
Adsense
(1)
PDF Import Extension
(1)
OOO
(1)
OpenOffice.Org
(1)
StarOffice
(1)
hybrid PDF
(1)
Server side dynamic serialization
(1)
更多
随笔分类
(177)
.Net(8)
Code Snippets(5)
CRM(1)
doodads
DotNet News(6)
GCJ(7)
Hosting(空间)(5)
iTextSharp(iText#)(52)
PDF Hacks(8)
PDFCreator(2)
Ruby on Rails(3)
Self Publishing(4)
雕虫小技(24)
软件发布(2)
心情记录(30)
学习日记(20)
PDF
积分与排名
积分 - 548508
排名 - 101
最新评论
阅读排行榜
评论排行榜
推荐排行榜