1 |
|
---|
2 | function urlGetSync(url)
|
---|
3 | {
|
---|
4 | // alert("url = " + url);
|
---|
5 |
|
---|
6 | var xmlHttp;
|
---|
7 | try {
|
---|
8 | // Firefox, Opera 8.0+, Safari
|
---|
9 | xmlHttp=new XMLHttpRequest();
|
---|
10 | }
|
---|
11 | catch (e) {
|
---|
12 | // Internet Explorer
|
---|
13 | try {
|
---|
14 | xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
|
---|
15 | }
|
---|
16 | catch (e) {
|
---|
17 | try {
|
---|
18 | xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
|
---|
19 | }
|
---|
20 | catch (e) {
|
---|
21 | alert("Your browser does not support AJAX!");
|
---|
22 | return false;
|
---|
23 | }
|
---|
24 | }
|
---|
25 | }
|
---|
26 |
|
---|
27 | xmlHttp.open("GET",url,false);
|
---|
28 | xmlHttp.send(null);
|
---|
29 |
|
---|
30 | // alert("response = '" + xmlHttp.responseText + "'");
|
---|
31 |
|
---|
32 | return xmlHttp.responseText;
|
---|
33 | }
|
---|
34 |
|
---|
35 | function urlPostSync(url,params)
|
---|
36 | {
|
---|
37 | // alert("url = " + url);
|
---|
38 |
|
---|
39 | var xmlHttp;
|
---|
40 | try {
|
---|
41 | // Firefox, Opera 8.0+, Safari
|
---|
42 | xmlHttp=new XMLHttpRequest();
|
---|
43 | }
|
---|
44 | catch (e) {
|
---|
45 | // Internet Explorer
|
---|
46 | try {
|
---|
47 | xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
|
---|
48 | }
|
---|
49 | catch (e) {
|
---|
50 | try {
|
---|
51 | xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
|
---|
52 | }
|
---|
53 | catch (e) {
|
---|
54 | alert("Your browser does not support AJAX!");
|
---|
55 | return false;
|
---|
56 | }
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|
60 | xmlHttp.open("POST",url,false);
|
---|
61 |
|
---|
62 | xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
---|
63 | xmlHttp.setRequestHeader("Content-length", params.length);
|
---|
64 | xmlHttp.setRequestHeader("Connection", "close");
|
---|
65 |
|
---|
66 | xmlHttp.send(params);
|
---|
67 |
|
---|
68 | // alert("response = '" + xmlHttp.responseText + "'");
|
---|
69 |
|
---|
70 | return xmlHttp.responseText;
|
---|
71 | }
|
---|
72 |
|
---|
73 |
|
---|
74 |
|
---|
75 |
|
---|