Created
January 28, 2015 12:25
-
-
Save wwsun/d34ce8c198584bff149d to your computer and use it in GitHub Desktop.
Parse.com demo code: save an object to parse.com
This file contains hidden or 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
$(document).ready(function() { | |
var parseApplicationId = "XbBMwuGt3JYTCV5FMb5g35RbM2hYEuidQBGi0SCa"; | |
var parseJavaScriptKey = "Cna6YP1oqG1ZdprY5bXBl2cdIv3T11e6Fna6bmkU"; | |
Parse.initialize(parseApplicationId, parseJavaScriptKey); | |
var Test = Parse.Object.extend("Test"); | |
var test = new Test(); | |
test.save({name: "John", text:"hi"}, { | |
success: function(object) { | |
console.log("Parse.com object is saved: "+object); | |
}, | |
error: function(object) { | |
console.log("Error! Parse.com object is not saved "+ object); | |
} | |
}); | |
}); |
This file contains hidden or 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
<html> | |
<head> | |
</head> | |
<body> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="http://cdn.jsdelivr.net/parse/1.2.9/parse.min.js"></script> | |
<script src="app.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment