Need help displaying a JSON file in HTML -


i received vps digitalocean , have been trying make page display status of vps. digitalocean has api dont know started.

my json file goes this:

{"status":"ok","droplets":[{"id":00000,"name":"jamieduke","image_id":0000,"size_id":00,"region_id":4,"backups_active":false,"ip_address":"0.0.0.0","private_ip_address":null,"locked":false,"status":"active","created_at":"2014-04-21t23:45:51z"}]} 

update: havent tried code. have been looking high , low works. also, json code showed there pulled webpage , has to live update 2: total newb when comes css , javascript. language can html. can please me other parts needed? need script project.

also, need pull script pulled url.

it's simple

var data = json.parse(jsonstring); var html = [], =0; ln = data.droplets.length;  html.push('<div class="style-div">data.status</div>'); for(i=0; i<ln;i++) {   var droplet = droplet[i];   for(var prop in droplet) {     html.push('<div class="style-droplet-inner">'+droplet[prop]+'</div>');   } } body.innerhtml = html.join(''); 

you need worry css now.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -