01.
<input type=
"checkbox"
name=
"chk"
OnClick=
"update(this.value,);"
><span id=
"action1"
></span>
02.
<script language=
"javascript"
type=
"text/javascript"
>
03.
function
update(value){
04.
$.ajax({
05.
type:
"GET"
,url:
"update_data.php"
,data:
"action=updateData&id=1&value="
+value+
"&dumy="
+Math.random(),timeout: 6000,dataType:
"text/html"
,
06.
error:
function
(){alert(
'Loading time out'
);},
07.
beforeSend:
function
(){$(
"#action1"
).html(
"<img src='images/loading.gif'>"
);},
08.
success:
function
(html){$(
"#action1"
).html(html);}
09.
});
10.
}
11.
</script>