Skip to content

Instantly share code, notes, and snippets.

@cuduy197
Last active March 16, 2017 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cuduy197/0dd9fed3407ee9549ddfa623a5250cd5 to your computer and use it in GitHub Desktop.
Save cuduy197/0dd9fed3407ee9549ddfa623a5250cd5 to your computer and use it in GitHub Desktop.
json(url,id,firebase_p,firebase_c,log=0)
var json = (url,id,firebase_p,firebase_c,log=0) => {
fetch(url).then((r) =>{
return r.json();
}).then((d) => {
log==1?console.log(d):()=>{};
localStorage.firebase_length = Object.keys(d.demo).length;
document.getElementById(id.toString()).innerHTML = d[firebase_p][firebase_c]
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment