json - Grabbing data from firebase with javascript -


i have following code grab data , view in console firebase setup, have no idea why isn't working. here code below. running live @ site if want inspect it. here link jsfiddle

<!doctype html> <html lang="en" ng-app="demoapp"> <head>    <meta charset="utf-8">   <meta name="viewport" content="width=device-width"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>   <script type='text/javascript' src='https://cdn.firebase.com/js/client/1.0.11/firebase.js'></script>    <script type="text/javascript"> var dataref = new firebase('https://edengarden.firebaseio.com/test'); dataref.on('value', function(snapshot) {   console.log(snapshot.val()); }); </script> </head> <body> </body> </html> 

if change javascript this:

var mydataref = new firebase('https://edengarden.firebaseio.com/test'); mydataref.on('child_added', function(snapshot) {     var message = snapshot.val();     console.log(message); }); 

it logs lot of objects, this:

object {value: 11}

object {value: 11}

object {value: 11}

object {value: 15}

...

is not see/expected?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -