I am creating a two page web based app. Page 1 allows the user to enter a first name, last name, and message and adds it to the firebase DB using push(). I have gotten this to work perfectly.
On page 2 I want it to display all the messages. Ideally, I want to be able to add search parameters for names, but I'll start at the bottom of the mountain and work my way up. My problem is that everytime I use a callback the browser displays "[object Object]" as opposed to any useful information.
I've been playing around with it and searching for answers for a couple hours with no luck. Any help would be greatly appreciated.
<script type="text/javascript">
var messageRef = new Firebase("https://x.firebaseio.com/messages/");
messageRef.on('value', function(snapshot) {
var message = snapshot.val();
displayMessage(message);
});
function displayMessage(name){
document.getElementById("content").innerHTML = name;
}
</script>