Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var pdatabase= '{ "pobject" : [' +
- '{ "pname":"Pikachu" , "pid":"1" },' +
- '{ "pname":"Squirtle" , "pid":"2" },' +
- '{ "pname":"Justinbieber" , "pid":"3" }]}';
- </script>
- <script>
- $(function() {
- ppdatabase = JSON.parse(pdatabase);
- plenth=ppdatabase.pobject.length;
- test=console.log(plenth);
- });
- </script>
- var pdatabase= '{ "pobject" : [' +
- '{ "pname":"Pikachu" , "pid":"1" },' +
- '{ "pname":"squirtle" , "pid":"2" },' +
- '{ "pname":"Justinbieber" , "pid":"3" }]}';
- <script src="obdatabase.json"></script>
- <script>
- $(function() {
- ppdatabase = JSON.parse(pdatabase);
- plenth=ppdatabase.pobject.length;
- test=console.log(plenth);
- });
- </script>
- <script>
- $.get('obdatabase.json', function(pdatabase) {
- ppdatabase = JSON.parse(pdatabase);
- plenth=ppdatabase.pobject.length;
- test=console.log(plenth);
- });
- </script>
- {
- "pobject": [{
- "pname": "Pikachu",
- "pid": "1"
- }, {
- "pname": "squirtle",
- "pid": "2"
- }, {
- "pname": "Justinbieber",
- "pid": "3"
- }]
- }
- $.getJSON('obdatabase.json', function(pdatabase) {
- plenth=ppdatabase.pobject.length;
- test=console.log(plenth);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement