oxjs/demos/test/app.html
2010-01-27 18:55:37 +05:30

31 lines
1.2 KiB
HTML

<!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() {
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');
}
});
});
</script>
</head>
<body></body>
</html>