Created
December 19, 2012 21:36
-
-
Save vsergeyev/4340743 to your computer and use it in GitHub Desktop.
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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> | |
<script type='text/javascript' src='https://cdn.firebase.com/v0/firebase.js'></script> | |
<script src="firebase-models.js"></script> | |
<script> | |
var Chat = {}; | |
$.extend(Chat, FirebaseModels.Model, { | |
type: "Chat", | |
firebase: new Firebase("https://blabla.firebaseio-demo.com/Chat/") | |
}); | |
Chat.put({"text": "Hi there!"}, function(id) {console.log("OK", id);}, function() {console.log("ERROR!!!");}); | |
Chat.get("19b3ef3e-dc65-74b0-bada-f40085459d29", function(item) {console.log(item)}); | |
Chat.get("not-existing-item-id", function(item) {console.log(item)}); | |
Chat.all(function(items) {console.log(items)}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment