Created
September 17, 2012 02:06
-
-
Save cfjedimaster/3735178 to your computer and use it in GitHub Desktop.
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
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width"> | |
<script type="text/javascript" src="jquery-1.8.1.min.js"></script> | |
<script type="text/javascript" src="http://www.parsecdn.com/js/parse-1.0.23.min.js"></script> | |
<script> | |
var SightingObject; | |
$(document).ready(function() { | |
Parse.initialize("8Y0x2rCA0jKYdiC7wLKQuF9nQqKGFKdpqUHMfue3", "8m7ng0w9UirTV6k4ExsJ0WsmPGeZMsJd5hcu54Oq"); | |
SightingObject = Parse.Object.extend("SightingObject"); | |
var query = new Parse.Query(SightingObject); | |
query.find({ | |
success: function(results) { | |
var s = ''; | |
for(var i=0, len=results.length; i<len; i++) { | |
var result = results[i]; | |
s+= '<p>'; | |
s+= '<b>ID:</b> '+ result.id + '<br/>'; | |
s+= 'Number of UFOs: ' + result.attributes.numufos + '<br/>'; | |
s+= 'Reporter Name: ' + result.attributes.yourname + '<br/>'; | |
s+= 'Description: ' + result.attributes.description; | |
s+= '</p>' | |
} | |
$("#list").html(s); | |
}, | |
error: function(error) { | |
alert("Error: " + error.code + " " + error.message); | |
} | |
}); | |
}); | |
</script> | |
<style> | |
body { | |
margin-left: 25px; | |
margin-right: 25px; | |
font-family: arial; | |
} | |
input { | |
width: 100%; | |
height: 25px; | |
} | |
textarea { | |
width: 100%; | |
} | |
</style> | |
</head> | |
<body> | |
<h2>Sighting Reporter</h2> | |
<div id="list"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment