Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <body>
- <script src="https://unpkg.com/mithril/mithril.js" rel="stylesheet"></script>
- <script>
- console.log('Version', m.version);
- console.log('Before request');
- var p = m.request({
- //url: 'http://www.google.fr',
- url: 'http://not-exists',
- // user: 'test',
- // password: 'test'
- });
- console.log('Request sent', p);
- p.then(function(result) {
- console.log('Promise resolved', result);
- }).catch(function(error) {
- console.log('Promise failed', error);
- });
- setTimeout(function() {
- console.log('After 5 seconds:', p);
- }, 5000);
- setTimeout(function() {
- console.log('After 60 seconds:', p);
- }, 60000);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement