-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddcourse_multi_ajax_1062.js
More file actions
32 lines (31 loc) · 1017 Bytes
/
addcourse_multi_ajax_1062.js
File metadata and controls
32 lines (31 loc) · 1017 Bytes
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
32
javascript:
var classCode = ["0242", "0276", "0265", "1834"]; //Put your class codes in this array.
var ms_VS = $("#__VIEWSTATE").val(),
ms_VSG = "2E66DAD8",
ms_EV = $("#__EVENTVALIDATION").val();
$.each(classCode, function(k, v) {
console.log(k);
$.ajax({
type: "POST",
url: "action.aspx",
data: {
__EVENTTARGET: "btnAdd",
__EVENTARGUMENT: "",
__VIEWSTATE: ms_VS,
__VIEWSTATEGENERATOR: ms_VSG,
__EVENTVALIDATION: ms_EV,
txtCosEleSeq: v
},
success: function(data) {
var el = $("<div></div>");
el.html(data);
var msg1 = v + $("#GridView2>tbody>tr:nth-child(2)>td:nth-child(5)",el).text();
console.log(msg1);
var msg2 = $("#form1>div:nth-child(4)>table>tbody>tr:nth-child(2)>td:nth-child(3)",el).text();
msg2 = msg2.replace("\n", "");
msg2 = msg2.replace(".... 請輸入開課序號後, 再按功能鍵...", "");
msg2 = msg2.replace(/\s/g, "");
console.log("加選狀態:" + msg2);
}
});
});