2011-07-15 チューニングが楽になる JavaScript 道具箱

8,203 views

Published on

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,203
On SlideShare
0
From Embeds
0
Number of Embeds
1,826
Actions
Shares
0
Downloads
25
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

2011-07-15 チューニングが楽になる JavaScript 道具箱

  1. 1. JavaScript2011-07-15 CA × pixiv 1
  2. 2. 2
  3. 3. 3
  4. 4. 4
  5. 5. pixiv.lazyImage 5
  6. 6. 6
  7. 7. <img class="ui-lazy-image" src="transparent.png" data-src="image.png"> 7
  8. 8. 8
  9. 9. pixiv.throttle 9
  10. 10. 10
  11. 11. $(window).scroll($.proxy(this.onscroll, this));!$(window).scroll(pixiv.throttle(this.onscroll, this)); 11
  12. 12. 12
  13. 13. pixiv.api.request $.ajax + Storage API 13
  14. 14. 14
  15. 15. pixiv.api.get(/api/foo, queries);// sessionStoragepixiv.api.get(/api/foo, queries, {cache: true});// localStoragepixiv.api.get(/api/foo, queries, {cache: +new Date + 604800000}); // 1w// Objectpixiv.api.get(/api/foo, queries, {cache: pixiv.foo.data}); 15
  16. 16. // jQuery Deferredpixiv.api.get(/api/foo, queries, {cache: true}) .done(function(data) { ... }) .fail(function(e) { ... }); 16
  17. 17. 17
  18. 18. 18
  19. 19. 19
  20. 20. p(ixi)v < 20

×