Subscribe:Posts Comments

You Are Here: Home Thủ thuật blog Chèn Box Google Search vào blog

PUT GOOGLE SEARCH BOX IN BLOG
[FD's BlOg] - Thủ thuật này hơi cũ, nhưng hôm nay mình cũng xin giới thiệu lại. Với thủ thuật này, bạn có thể áp dụng cho nhiều trang web search khác nhau, chỉ cần thay đổi code 1 chút là có thể làm được. Ở đây mình chỉ giới thiệu với Google.

Đầu tiên, chọn nơi muốn hiển thị Box search, rồi tạo 1 widget HTML/Java rồi dán code vào. Ở đây mình sẽ giới thiệu Google Search và Google BlogSearch.

1. Google search:

Hình minh họa:
Code:

<form action="http://www.google.com/search" method="get"target="_blank"><div style="border: 0px solid #ccc; padding: 4px; width: 20em;">
<table border="0" cellpadding="0">
<tbody><tr><td>
<input style="width: 120px;"maxlength="255" value="" name="q" size="25" type="text"/>
<input value="Tìm Kiếm" type="submit"/></td></tr>
<tr><td align="left">
<input checked="checked" value="YourBlog.blogspot.com" name="sitesearch" type="checkbox"/> Chỉ tìm kiếm ở Blog này</td></tr></tbody></table></div></form>

Có thể thay đổi các dòng code màu đỏ để trang trí box search theo ý bạn.

2. Google Blogsearch:
Hình minh họa:

Code:

<FORM METHOD="GET" ACTION="http://blogsearch.google.com/">
<INPUT TYPE="hidden" name="num" value="10" />
<INPUT TYPE="hidden" name="hl" value="en" />
<input name="as_sitesearch" value="YOURBLOG_URL" type="hidden">
<INPUT TYPE="text" NAME="as_q" style="width: 100px;" />
<INPUT TYPE="submit" value="Google Blog Search" />
</FORM>



nếu muốn mở tab mới



<form action="http://blogsearch.google.com/" target="_blank" method="get" style="margin: 0px; padding: 0px;">
<input type="text" maxlength="255" style="width: 200px;" value="" name="q" size="25" /><input type="submit" value="Tìm Kiếm" />
<input type="hidden" checked value="hzing.blogspot.com" name="sitesearch" />
</form>


nguồn: http://fandung.com


0 nhận xét

Leave a Reply