silverstripe-framework/thirdparty/jasmine-ajax/examples/jquery/public/index.html

61 lines
1.9 KiB
HTML
Raw Normal View History

<!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="../../../frameworks/jquery.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="index.html#" 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">
$(function(){
$("#twit_search form").submit(function(e){
e.preventDefault();
var search_query = $("#query").val();
new TwitterApi().search(
search_query, {
onSuccess: TwitSearch.displayResults,
onFailure: TwitSearch.searchFailure
// onComplete: TwitSearch.cleanup,
// onFailWhale: TwitSearch.failWhale
}
);
});
});
// 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: TwitSearch.displayResults,
// onFailure: TwitSearch.searchFailure,
// onComplete: TwitSearch.cleanup,
// onFailWhale: TwitSearch.failWhale
// }
// );
// });
// });
</script>
</div>
</body>
</html>