xbl12
Programmer
- Dec 12, 2006
- 66
Hi;
I am try to write a program for website search.
I want my home page will display Australia news when user come in, and when user click a link, it will bring out new zealand news and display in the home page, But i could not do that, could anyone help me, please, thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns=" <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Search API Sample</title>
<script src=" type="text/javascript"></script>
<script type="text/javascript">
/*
* How to do a search that returns the max number of results per page.
*/
google.load('search', '1');
function OnLoad(mystr) {
// create a search control
var searchControl = new google.search.SearchControl();
// Set the Search Control to get the most number of results
searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
// Create 2 searchers and add them to the control
searchControl.addSearcher(new google.search.WebSearch());
searchControl.addSearcher(new google.search.BlogSearch());
// Set the options to draw the control in tabbed mode
var drawOptions = new google.search.DrawOptions();
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
// Draw the control onto the page
searchControl.draw(document.getElementById("content"), drawOptions);
// Search!
searchControl.execute(mystr);
}
google.setOnLoadCallback(OnLoad("australia news"));
</script>
</head>
<a href="index.php?search=new zealand news" onClick="onLoad("new zealand News")">new zealand news</a>
<body style="font-family: Arial;border: 0 none;">
<div id="content">Loading...</div>
</body>
</html>
I am try to write a program for website search.
I want my home page will display Australia news when user come in, and when user click a link, it will bring out new zealand news and display in the home page, But i could not do that, could anyone help me, please, thanks.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "<html xmlns=" <head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google AJAX Search API Sample</title>
<script src=" type="text/javascript"></script>
<script type="text/javascript">
/*
* How to do a search that returns the max number of results per page.
*/
google.load('search', '1');
function OnLoad(mystr) {
// create a search control
var searchControl = new google.search.SearchControl();
// Set the Search Control to get the most number of results
searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
// Create 2 searchers and add them to the control
searchControl.addSearcher(new google.search.WebSearch());
searchControl.addSearcher(new google.search.BlogSearch());
// Set the options to draw the control in tabbed mode
var drawOptions = new google.search.DrawOptions();
drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
// Draw the control onto the page
searchControl.draw(document.getElementById("content"), drawOptions);
// Search!
searchControl.execute(mystr);
}
google.setOnLoadCallback(OnLoad("australia news"));
</script>
</head>
<a href="index.php?search=new zealand news" onClick="onLoad("new zealand News")">new zealand news</a>
<body style="font-family: Arial;border: 0 none;">
<div id="content">Loading...</div>
</body>
</html>