Repository navigation
Expand file tree
/
Copy pathax.js
More file actions
116 lines (112 loc) · 3.83 KB
/
Copy pathax.js
File metadata and controls
116 lines (112 loc) · 3.83 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// JavaScript Document
function LayNoiDung(url)
{
url+="&thdiem=".concat((new Date()).getTime());
try{
var h;
if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");
else h= new XMLHttpRequest();
h. {
if (h.readyState==4)
if (h.status==200)
document.getElementById('Content').innerHTML=h.responseText;
else alert("Không lấy dữ liệu được. " + h.statusText+ "-"+ h.responseText);
}
h.open("GET",url,false);
h.send(null);
}
catch (e) { alert("Lỗi "+ e.description + "-"+ h.responseText);}
}
function KetQuaBinhChon(url,tendoituong)
{
url+="&thdiem=".concat((new Date()).getTime());
try{
var h;
if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");
else h= new XMLHttpRequest();
h. {
if (h.readyState==4)
if (h.status==200)
document.getElementById(tendoituong).innerHTML=h.responseText;
else alert("Không lấy dữ liệu được. " + h.statusText+ "-"+ h.responseText);
}
h.open("GET",url,false);
h.send(null);
}
catch (e) { alert("Lỗi "+ e.description + "-"+ h.responseText);}
}
function chonSP(url){
url+="&thdiem=".concat((new Date()).getTime());
try{
var h;
if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");
else h= new XMLHttpRequest();
h. {
if (h.readyState==4)
if (h.status==200)
document.getElementById('giohang').innerHTML=h.responseText;
else alert("Không lấy dữ liệu được. " + h.statusText+ "-"+ h.responseText);
}
h.open("GET",url);
h.send(null);
}
catch (e) { alert("Lỗi "+ e.description + "-"+ h.responseText);}
}
function checkusername1(url,obj)
{
url+="?Username="+ obj.value;
url+="&thdiem=".concat((new Date()).getTime()); /*de len server lay chinh xac hon*/
try{
var h;
if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP"); /* window.activeXObject: trinh duyet la ie */
else h= new XMLHttpRequest(); /* readyState co 4 trang thai la 1, 2,3,4*/
h. {
if (h.readyState==4) /* readyState=4 du lieu da tra ve */
if (h.status==200) /* cho biet trang request chay ok hay ko */
if (h.responseText!=0) { /* du lieu do ve, khac 0 la de co nguoi dung */
document.getElementById('thongbao').innerHTML=h.responseText;
document.getElementById('KT_Insert1').disabled=true;
obj.focus();
obj.select(); /* boi den dong chu */
}
else {
document.getElementById('thongbao').innerHTML=""; /* co the go chu de thay the dau nhay */
document.getElementById('KT_Insert1').disabled=false;
}
else alert("Không lấy dữ liệu được. " + h.statusText+ "-"+ h.responseText);
}
h.open("GET",url,false); /* chuẩn bị kết nối được tạo trong bộ nhớ */
h.send(null);
}
catch (e) { alert("Lỗi "+ e.description + "-"+ h.responseText);}
}
<!-- Kiểm tra email -->
function checkemail1(url,obj)
{
url+="?Email="+ obj.value;
url+="&thdiem=".concat((new Date()).getTime());
try{
var h;
if(window.ActiveXObject) h=new ActiveXObject("Microsoft.XMLHTTP");
else h= new XMLHttpRequest();
h. {
if (h.readyState==4)
if (h.status==200)
if (h.responseText!=0) {
document.getElementById('thongbao_email').innerHTML=h.responseText;
document.getElementById('KT_Insert1').disabled=true;
obj.focus();
obj.select();
}
else {
document.getElementById('thongbao_email').innerHTML="";
document.getElementById('KT_Insert1').disabled=false;
}
else alert("Không lấy dữ liệu được. " + h.statusText+ "-"+ h.responseText);
}
h.open("GET",url,false);
h.send(null);
}
catch (e) { alert("Lỗi "+ e.description + "-"+ h.responseText);}
}
/* End */