Created
August 1, 2013 06:03
-
-
Save Anenth/6128752 to your computer and use it in GitHub Desktop.
Parse js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.2.8.min.js"></script> | |
Parse.initialize("CqvQbKeavBips6SMg1w2HVl1dPFwdq3KOTYOhpwg", "Xu3fHRW5GWhVPgFFvlMiK0ACFSkaSmmzn8I87XqM"); //application key | |
var TestObject = Parse.Object.extend("TestObject"); | |
//adding new element to the db | |
var testObject = new TestObject(); | |
testObject.save( | |
{ | |
foo: "bar" | |
},{ | |
success: function(object) { }, | |
error: function(model, error) {} | |
}); | |
//fetching data | |
var query = new Parse.Query(TestObject); | |
query.get("xWMyZ4YEGZ", { //object id | |
success: function(gameScore) {}, | |
error: function(object, error) {} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment