Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let result = '';
- let map = [];
- fetch(link)
- .then(function(response) {
- return response.json();
- }).then(function(json) {
- result = JSON.stringify(json); //json here is like [{'a':1,'a2':2},{'b':11,'b2':12}]
- result = result.substring(1, result.length-1);
- map = JSON.parse(result);
- }).catch(function(ex) {
- console.log('parsing failed', ex);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement