Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 실버라이트
- COM+
- XML
- 자바스크립트
- 해킹
- C#
- Sliverlight
- ASP.NET
- silverlight
- 게으름
- 리팩토링
- Web 2.0
- .net
- 검색
- 구글
- GDI+
- hnd-7070
- JavaScript
- WEb 2.0 Expo
- 형태소분석기
- MS
- Ajax
- jQuery
- 실버라이트2
- 성공
- 개발자
- GTD
- 암호화
- 전기차
- 백신
Archives
- Today
- Total
꿈으로 가는 작은 계단
jQuery Async Plugin 본문
jQuery Async Plugin
This plugin allows to easily code very long-lasting loops in an asynchronous way to avoid losing the browser responsiveness.
jQuery.whileAsync(opts)
This function ease the building of an asynchronnous loop with a while structure.
- opts
-
- test
- (default: returns true) function to execute for the test part of the while loop
- loop
- (default: nothing) function to execute as the loop body
- end
- (default: nothing) function to execute at the end of the loop iteration
- delay
- (default: 10) delay in milliseconds between each asynchronous calls
- bulk
- (default: 500) maximum delay in milliseconds the loop is allowed to run without any asynchronous calls. 0 to disable.
var test = jQuery('#TestWhile');
test.empty();
var n = 10;
jQuery.whileAsync({
delay: 100,
bulk: 0,
test: function() { return n > 0 },
loop: function()
{
test.text(test.text() + ' ' + n);
n--;
},
end: function()
{
test.text(test.text() + ' END');
}
})
jQuery.eachAsync(array, opts)
This function ease the building of a for-each loop.
- array
- array or array-like to use for the iteration
- opts
-
- loop
- function(index, value) (default: nothing) function to execute as the loop body
- end
- function() (default: nothing) function to execute at the end of the loop iteration
- delay
- (default: 10) delay in milliseconds between each asynchronous calls
- bulk
- (default: 500) maximum delay in milliseconds the loop is allowed to run without any asynchronous calls. 0 to disable.
var test = jQuery('#TestEach');
test.empty();
var n = 10;
jQuery.eachAsync([1,2,3,4,5,6,7,8,9,10], {
delay: 100,
bulk: 0,
loop: function(index, value)
{
test.text(test.text() + ' ' + value);
},
end: function()
{
test.text(test.text() + ' END');
}
})
jQuery.fn.eachAsync(opts)
This function is the same as jQuery.eachAsync() but works directly on a jQuery.
- opts
-
- loop
- function(index, value) (default: nothing) function to execute as the loop body
- end
- function() (default: nothing) function to execute at the end of the loop iteration
- delay
- (default: 10) delay in milliseconds between each asynchronous calls
- bulk
- (default: 500) maximum delay in milliseconds the loop is allowed to run without any asynchronous calls. 0 to disable.
var n = 10;
jQuery('#TestFnEach span').empty().eachAsync({
delay: 100,
bulk: 0,
loop: function(index)
{
jQuery(this).text(index+' ');
}
})
출처 : http://mess.genezys.net/jquery/jquery.async.php
'소프트웨어 > JavaScript • Dhtml' 카테고리의 다른 글
| HTML5.js (0) | 2009.07.08 |
|---|---|
| JSON javascript 읽기 (0) | 2009.07.03 |
| Masked Input plugin (0) | 2009.06.29 |
| JSON API 하이재킹, Ajax Security (0) | 2009.05.21 |
| Javascript Packer & 암호화 - C# (0) | 2008.06.30 |