<!--
copyright (c) 2009 Google inc. You are free to copy and use this sample.
License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<title>Google AJAX Search API Sample</title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></script>
<script type="text/javascript">
/*
* The Hello World of the AJAX Search API
*/
google.load('search', '1');
function OnLoad() {
// Create a search control
var searchControl = new google.search.SearchControl();
// Add in a full set of searchers
var localSearch = new google.search.LocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new google.search.WebSearch());
searchControl.addSearcher(new google.search.VideoSearch());
searchControl.addSearcher(new google.search.BlogSearch());
searchControl.addSearcher(new google.search.NewsSearch());
searchControl.addSearcher(new google.search.ImageSearch());
searchControl.addSearcher(new google.search.BookSearch());
searchControl.addSearcher(new google.search.PatentSearch());
// Set the Local Search center point
//localSearch.setCenterPoint("New York, NY");
// tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("content"));
// execute an inital search
searchControl.execute("北京租房");
}
google.setOnLoadCallback(OnLoad);
function content()
{
s1=document.getElementById("content").firstChild.outerHTML;
document.writeln(s1);
}
</script>
</head>
<body style="font-family: Arial;border: 0 none;" >
<INPUT TYPE= "button" value="提交" onclick = "content() ">
<div id="content">Loading...</div>
<div id="content2">
</div>
</body>
</html>以上代码是google api调用,点击提交后,能将调用的内容输出到新的结果中, 现在我想要在程序加载完成后自动执行提交的动作,该如何操作,请高人指点!
copyright (c) 2009 Google inc. You are free to copy and use this sample.
License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<title>Google AJAX Search API Sample</title>
<script src="http://www.google.com/jsapi?key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q"></script>
<script type="text/javascript">
/*
* The Hello World of the AJAX Search API
*/
google.load('search', '1');
function OnLoad() {
// Create a search control
var searchControl = new google.search.SearchControl();
// Add in a full set of searchers
var localSearch = new google.search.LocalSearch();
searchControl.addSearcher(localSearch);
searchControl.addSearcher(new google.search.WebSearch());
searchControl.addSearcher(new google.search.VideoSearch());
searchControl.addSearcher(new google.search.BlogSearch());
searchControl.addSearcher(new google.search.NewsSearch());
searchControl.addSearcher(new google.search.ImageSearch());
searchControl.addSearcher(new google.search.BookSearch());
searchControl.addSearcher(new google.search.PatentSearch());
// Set the Local Search center point
//localSearch.setCenterPoint("New York, NY");
// tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("content"));
// execute an inital search
searchControl.execute("北京租房");
}
google.setOnLoadCallback(OnLoad);
function content()
{
s1=document.getElementById("content").firstChild.outerHTML;
document.writeln(s1);
}
</script>
</head>
<body style="font-family: Arial;border: 0 none;" >
<INPUT TYPE= "button" value="提交" onclick = "content() ">
<div id="content">Loading...</div>
<div id="content2">
</div>
</body>
</html>以上代码是google api调用,点击提交后,能将调用的内容输出到新的结果中, 现在我想要在程序加载完成后自动执行提交的动作,该如何操作,请高人指点!
document.form.getElementbyId("content").innerHTML = "哈哈"