-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
42 lines (34 loc) · 1.28 KB
/
Copy pathexample.html
File metadata and controls
42 lines (34 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta charset="utf-8">
<title>Javascript client for ProtoAPI</title>
<style type="text/css">
</style>
</head>
<body>
<!--
Note: This example outputs everything to console.log
-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="protoapi.js"></script>
<script>
protoapi( { appid: "4f2b8c5d3dcd200e6900005e", appkey: "25b0aa7b3cde834b90ca30a15ed03b9c", classname: 'posts' } ).post({ name: "test2", user: "pepito" }, function( data ){
console.log( data );
});
protoapi( 'posts' ).get( { name: "test2" }, function( data ){ console.log(data); } );
protoapi( 'posts' ).save( { name: "Oscar", user: "Meng" }, function( data ){
console.log(data);
data.name = 'YuanYuan';
protoapi( 'posts' ).save( data, function( _data ){
console.log(_data);
protoapi( 'posts' ).get({ _id: data._id }, function( data ){ console.log(data); });
});
});
/*$("Posts").protoapi().post({ name: "Oscar", user: "Meng", _id: "fail" }, function( data ){
console.log(data);
});*/
</script>
</body>
</html>