jasmine-ajax/public/index.html

49 lines
1.6 KiB
HTML

<!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" />
<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>
</head>
<body>
<div id="wrap">
<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>
<script type="text/javascript">
document.observe('dom:loaded', function(){
$$("#twit_search form").first().observe("submit", function(event) {
event.preventDefault();
var search_query = $("query").value
new TwitterApi().search(
search_query, {
// onSuccess should parse the JSON, then hand off the array of tweet objects to this method
onSuccess: TwitSearch.displayResults,
onFailure: TwitSearch.searchFailure,
onComplete: TwitSearch.cleanup,
on403: function(){
alert("fail whale");
}
}
);
});
});
</script>
</div>
</body>
</html>