01.
<script>
02.
$(
function
() {
03.
$(
'a.write-comment'
).click(
function
(event) {
04.
$(
'#form-comment'
)[0].reset();
05.
06.
07.
08.
event.preventDefault();
09.
10.
var
t =
"แสดงความคิดเห็น"
;
11.
12.
$(
'#form-dialog'
).dialog({
13.
width:
'600px'
,
14.
title: t,
15.
modal:
true
,
16.
position: { my:
"center"
, at:
"center"
, of: window}
17.
});
18.
19.
20.
$(
'#link-id'
).val($(
this
).attr(
'data-id'
));
21.
22.
});
23.
24.
25.
$(
'#submit-comment'
).click(
function
() {
26.
27.
$(
'form#form-comment'
).ajaxForm({
28.
url:
'save-comment.php'
,
29.
type:
'post'
,
30.
dataType:
'script'
,
31.
beforeSend:
function
() {
32.
$.blockUI({message:
'<h3>กำลังส่งข้อมูล...</h3>'
});
33.
},
34.
35.
complete:
function
() {
36.
37.
alert(
"111111111111111111111111111111"
)
38.
39.
$.unblockUI();
40.
}
41.
});
42.
});
43.
});
44.
</script>