-
Notifications
You must be signed in to change notification settings - Fork 7
/
ajax.js
53 lines (49 loc) · 1 KB
/
ajax.js
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
// JavaScript Document
//////////////////
//AJAX Functions//
//////////////////
function evalAJAXHtml(source){
if(window.XMLHttpRequest){
var ajax = new XMLHttpRequest();
}
else if(window.ActiveXObject){
var ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
ajax.open("GET",source,true);
ajax.onreadystatechange = function(){
try{
if(ajax.readyState == 4){
if(ajax.status == 200){
eval(ajax.responseText);
}
}
}
catch(e){
//Exception-bug in FF
}
}
ajax.send(null);
}
function evalpostAJAXHtml(source,datan){
if(window.XMLHttpRequest){
var ajax = new XMLHttpRequest();
}
else if(window.ActiveXObject){
var ajax = new ActiveXObject("Microsoft.XMLHTTP");
}
ajax.open("POST",source,true);
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function(){
try{
if(ajax.readyState == 4){
if (ajax.status == 200){
eval(ajax.responseText);
}
}
}
catch(e){
//Exception-bug in FF
}
}
ajax.send(datan);
}