上一页 1 ··· 417 418 419 420 421 422 423 424 425 ··· 494 下一页
摘要: For example, if the url is not match to any API endpoint, we want to return 404 error message. So first thing, we want to send the request to the serv 阅读全文
posted @ 2016-05-16 16:03 Zhentiw 阅读(215) 评论(0) 推荐(0)
摘要: Learn how to user console.count in order to log out how many times a given thing has happened. for(var i = 0; i < 10; i++){ var num = Math.random() * 阅读全文
posted @ 2016-05-16 15:37 Zhentiw 阅读(144) 评论(0) 推荐(0)
摘要: Learn about console.assert, which is syntactic sugar for logging an error the console when a given condition is not met. It's useful, but may not do w 阅读全文
posted @ 2016-05-16 15:32 Zhentiw 阅读(150) 评论(0) 推荐(0)
摘要: Organize your log output by grouping your logs into collapsable hierarchies using console.group(). for(var i = 0; i < 100; i++){ var num = Math.random 阅读全文
posted @ 2016-05-16 15:23 Zhentiw 阅读(162) 评论(0) 推荐(0)
摘要: Previously we saw how to Hijacking all the reqest, but this is not useful. So now we want to see how to Hijacking one kind of request. For example we 阅读全文
posted @ 2016-05-16 04:35 Zhentiw 阅读(184) 评论(0) 推荐(0)
摘要: With endsWith && startsWith, you can easily find out whether the string ends or starts with some other string: example: So you don't need to write reg 阅读全文
posted @ 2016-05-16 04:32 Zhentiw 阅读(436) 评论(0) 推荐(0)
摘要: We want to do offline first, the first thing we need to do is we should able to catch the browser request and return our cache data from serice worker 阅读全文
posted @ 2016-05-15 21:49 Zhentiw 阅读(160) 评论(0) 推荐(0)
摘要: You can debug with chrom dev tool: 1. Use console to debug service worker: Swith to sw.js context then you can access 'self' object 2. Set breakpoint: 阅读全文
posted @ 2016-05-15 21:08 Zhentiw 阅读(255) 评论(0) 推荐(0)
摘要: The No1. is because, service worker only take control after it is loaded. But the first time we go to the page, service worker actually is not there, 阅读全文
posted @ 2016-05-15 20:56 Zhentiw 阅读(192) 评论(0) 推荐(0)
摘要: Service worker stays between our browser and noetwork requests. It can help to fetch data from cache and cache the data from Internet. To get our serv 阅读全文
posted @ 2016-05-15 17:22 Zhentiw 阅读(265) 评论(0) 推荐(0)
上一页 1 ··· 417 418 419 420 421 422 423 424 425 ··· 494 下一页