oxjstmp/demos/test/app.html

32 lines
1.2 KiB
HTML
Raw Normal View History

2010-01-27 12:30:00 +00:00
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="../../build/js/jquery-1.4.js"></script>
<script type="text/javascript" src="../../build/js/ox.js"></script>
<script type="text/javascript" src="../../build/js/ox.ui.js"></script>
<script type="text/javascript">
$(function() {
2010-01-27 13:25:37 +00:00
var app = new Ox.App({
requestURL:"http://blackbook.local:8000/api/"
});
app.request('hello');
app.request('login', {'username':'test', 'password':'test'}, function(result) {
Ox.print(result);
if(result.status.code == 200) {
Ox.print(result);
app.request('preferences', function(result) {
Ox.print(result.data.preferences);
});
}
else if(result.status.code == 403) {
alert('login failed');
} else {
Ox.print('broken');
2010-01-27 12:30:00 +00:00
}
});
});
</script>
</head>
<body></body>
2010-01-27 13:25:37 +00:00
</html>