頁面中引用 Google 進行搜索

頁面中引用 Google 進行搜索:

<!DOCTYPE html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<script type="text/javascript">
function SearchGoogle()
{
var site = 'http://iteye.com/';
var keystr = encodeURIComponent(document.getElementById('google_q').value);
url = "http://www.g.cn/search?q=";
url = url+keystr;
url += "&ie=UTF-8&domains="+site+"&sitesearch="+site;
window.location=url;
}
function google_enter(event)
{
if(event.keyCode == 13)
{
SearchGoogle();
return false;
}
}
</script>
</head>
<body>
<div>
<input type="text" name="google_q" id="google_q" onkeydown="return google_enter(event)" />
 
<input onclick="SearchGoogle()" type="button" value="Google" />
</div>
</body>
</html>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章