jasmine-ajax/public/index.html

46 lines
1.4 KiB
HTML
Raw Normal View History

2010-07-27 11:35:13 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Jasmine BDD</title>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<link rel="stylesheet" type="text/css" href="css/master.css" />
2010-07-27 11:35:13 +08:00
<script type="text/javascript" src="javascripts/prototype.js"></script>
<script type="text/javascript" src="javascripts/TwitSearch.js"></script>
<script type="text/javascript" src="javascripts/TwitterApi.js"></script>
<script type="text/javascript" src="javascripts/Tweet.js"></script>
2010-07-27 11:35:13 +08:00
</head>
<body>
<div id="wrap">
2010-07-27 13:20:18 +08:00
<div id="twit_search">
<form action="#" method="get">
<input type="text" name="query" id="query" />
<input type="submit" value="Search Twitter" />
</form>
</div>
<ul id="results"></ul>
2010-07-27 11:35:13 +08:00
<script type="text/javascript">
2010-07-27 13:20:18 +08:00
2010-07-27 11:35:13 +08:00
document.observe('dom:loaded', function(){
2010-07-27 13:20:18 +08:00
$$("#twit_search form").first().observe("submit", function(event) {
event.preventDefault();
2010-07-27 13:20:18 +08:00
var search_query = $("query").value
new TwitterApi().search(
search_query, {
onSuccess: TwitSearch.displayResults,
onFailure: TwitSearch.searchFailure,
onComplete: TwitSearch.cleanup,
2010-08-01 10:22:33 +08:00
onFailWhale: TwitSearch.failWhale
2010-07-27 13:20:18 +08:00
}
);
2010-07-27 13:20:18 +08:00
});
2010-07-27 11:35:13 +08:00
});
</script>
</div>
2010-07-27 11:35:13 +08:00
</body>
</html>