Skip to content

Instantly share code, notes, and snippets.

@jarellano01
Created August 16, 2016 16:38
Show Gist options
  • Select an option

  • Save jarellano01/33c5d6b39e89f9a517af4b1e93944b0c to your computer and use it in GitHub Desktop.

Select an option

Save jarellano01/33c5d6b39e89f9a517af4b1e93944b0c to your computer and use it in GitHub Desktop.
Firebase on database value change script
database.ref().on("value", function(snapshot) {
console.log(snapshot.val());
$("#clickValue").html(snapshot.val().clickCount);
clickCounter = snapshot.val().clickCount;
}, function (errorObject) {
console.log("The read failed: " + errorObject.code);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment