摘要: So once you modify the code, service worker will auto create a new one and it won't take control over until the previous service work total die(close 阅读全文
posted @ 2016-05-16 21:19 Zhentiw 阅读(242) 评论(0) 推荐(0)
摘要: If you want your application works offline or lie-wifi. You need to use cache. API: Create Caches: Create single cache: Get the cache: When to start c 阅读全文
posted @ 2016-05-16 20:11 Zhentiw 阅读(304) 评论(0) 推荐(0)
摘要: 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 阅读(142) 评论(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 阅读(148) 评论(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 阅读(160) 评论(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 阅读(182) 评论(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 阅读(434) 评论(0) 推荐(0)