-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparseconverter.html
More file actions
58 lines (47 loc) · 1.68 KB
/
parseconverter.html
File metadata and controls
58 lines (47 loc) · 1.68 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="http://www.parsecdn.com/js/parse-1.6.14.min.js"></script>
</head>
<body>
<script type="text/javascript">
Parse.initialize("bmobCoB17mgSf7S9J6ZntiQGq5NEm2eIyHroyP9t", "Wut80Nd7rKFVvHEvT7K9jQMCV2HIO67OEH0pWaBe");
Parse.serverURL = 'https://rayfoodapp.herokuapp.com/parse'
// load the entire food source
var database = Parse.Object.extend("mastersizelist")
var query = new Parse.Query(database)
query.find({
success: function(results) {
console.log("Successfully retrieved " + results.length);
// Do something with the returned Parse.Object values
for (var i = 0; i < results.length; i++) {
var object = results[i];
console.log(object.get("SIZE"))
//alert(object.id + ' - ' + object.get('playerName'));
// construct new database
var newdatabase = Parse.Object.extend("MasterSizeListParse");
var db = new newdatabase();
db.set("SIZE", object.get("SIZE"))
db.save(null, {
success: function(database) {
// Execute any logic that should take place after the object is saved.
console.log('New Database Created');
},
error: function(gameScore, error) {
// Execute any logic that should take place if the save fails.
// error is a Parse.Error with an error code and message.
alert('Failed to create new object, with error code: ' + error.message);
}
});
}
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});
</script>
</body>
</head>
</html>