Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. let result = '';
  2. let map = [];
  3.  
  4. fetch(link)
  5. .then(function(response) {
  6. return response.json();
  7. }).then(function(json) {
  8. result = JSON.stringify(json); //json here is like [{'a':1,'a2':2},{'b':11,'b2':12}]
  9. result = result.substring(1, result.length-1);
  10. map = JSON.parse(result);
  11. }).catch(function(ex) {
  12. console.log('parsing failed', ex);
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement