asynchronous programming
event-driven programming
and implementation
asynchronous programming
vs
synchronous programming
ตัวอย่าง : ซื้อกาแฟ
var a = 0;
for(idx in arr){
if(Willbe(idx))
submitQurry(a,arr[idx]);
else
Poseidon(arr[idx,a]);
}
function submitForm(){
if(document.myForm.myText.value == ""){
alert("Please enter some text first");
}else{
document.myForm.mySubmit.click();
}
}
$.on('button', 'click', function onClick() {
console.log('You clicked the button!');
});
Code
Web , node ,cordova api
ลงทะเบียน
click
resize window
http request
call
no internet
หลังจากผ่านไป 1 วินาที log คำว่า
เมื่อคลิก ให้ log ว่า click
แสดง รายชื่อนักแสดงจาก function queryDB :
copy function นี้จาก
https://gist.github.com/vehas/067d982612fb0be3a1bb
แล้ว ลองใช้เจ้าสิ่งนี้เพื่อความสวยงาม