PDA

View Full Version : pass value



kamkam
Jul 10th, 2009, 06:09 AM
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" "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=utf-8"/>
<title>Google AJAX Search API Sample</title>
<script src="http://www.google.com/jsapi?key=ABQAKAAA_k9fXaTF9Ai297azVxtE-RREmyeMEZw1zmCSoUU6dea6VNajwBQ4DYI0LTkuKv4DXQLHA3ilxq-w6g" 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>

kamkam
Jul 10th, 2009, 10:43 AM
Thanks, i have known how to do it now

fside
Jul 16th, 2009, 07:13 AM
Thanks, i have known how to do it now

You don't really. I think you posted two messages, now, to the wrong forum. This 'Post a Javascript' is for working scripts that people might wish to share with others.

I've wondered, too, that the name of the forum isn't sufficiently descriptive for a newbie. I may even have mistakenly posted a question or problem here, once, myself.

As someone who has made this mistake just recently, I wonder what name you think would have alerted you to the nature of the forum, obviously other than - Post a Javascript?

Something like - Ready To Run Javascripts?

Or - Finished Script Share?

rnd me
Jul 16th, 2009, 10:13 AM
As someone who has made this mistake just recently, I wonder what name you think would have alerted you to the nature of the forum, obviously other than - Post a Javascript?

Something like - Ready To Run Javascripts?

Or - Finished Script Share?

"Script Repository" is accurate and doesn't scream "post your questions here"...