Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- "use strict";
- document.addEventListener('deviceready', onDeviceReady.bind(this), false);
- function onDeviceReady() {
- getData()
- .then(f=>console.log(f),
- e=>console.log(e.message));
- };
- function getData() {
- return new Promise((resolve, reject) => {
- fetch('./data/somedata.json')
- .then(function (response) {
- return response.json().then(function (json) {
- resolve(json);
- }).catch(e=>reject(e));
- }).catch(e=>reject(e));
- });
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement