-
-
Save katowulf/06bb918b58e02190742a to your computer and use it in GitHub Desktop.
Emulate socket.io behavior in Firefox
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
// the recipient of the socket.io transaction would look like this: | |
var fb = new Firebase('https://YOURINSTANCE.firebaseio.com'); | |
fb.on('value', function(ss) { | |
// here is the data transferred from the sender! | |
var data = ss.val(); | |
// if you want the data removed after it is received, then uncomment this | |
// ss.ref().remove(); | |
}); | |
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
// the sender would look like this | |
var fb = new Firebase('https://YOURINSTANCE.firebaseio.com'); | |
function pushToRecipients(newData) { | |
fb.set( newData ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment