2
/*--------------------------------------------------------------------------------
4
----------------------------------------------------------------------------------*/
6
var AJAXQueue = new Array;
7
var AJAXServiceRunning=false;
11
/*--------------------------------------------------------------------------------
14
This is the only interface to the AJAX wrapper. This makes the ajax service
15
browser agnostic and provides a single interface for all of the services.
17
Each service uses a different url and a different parameter layout.
19
----------------------------------------------------------------------------------*/
21
function AjaxService(servicename,serviceparam){
23
AJAXQueue.push(servicename);
24
AJAXQueue.push(serviceparam);
26
if(!AJAXServiceRunning){
27
AJAXServiceRunning=true;
28
var Aparam=AJAXQueue.pop();
29
var Aservice=AJAXQueue.pop();
30
AjaxServiceExec(Aservice,Aparam);
34
/*--------------------------------------------------------------------------------
37
This is the only interface to the AJAX wrapper. This makes the ajax service
38
browser agnostic and provides a single interface for all of the services.
40
Each service uses a different url and a different parameter layout.
42
----------------------------------------------------------------------------------*/
44
function AjaxServiceExec(servicename,serviceparam){
46
// Parameters are set, initiate AJAX engine
47
if (window.XMLHttpRequest) {
48
httpAjax = new XMLHttpRequest();
49
if (httpAjax.overrideMimeType) {
50
httpAjax.overrideMimeType('text/xml');
52
}else if(window.ActiveXObject){
54
httpAjax = new ActiveXObject("Msxml2.XMLHTTP");
57
httpAjax = new ActiveXObject("Microsoft.XMLHTTP");
59
alert("Couldn�t build an AJAX instance.");
65
// Send request to Server and initiate callback.
68
httpAjax.onreadystatechange = getPage;
70
// alert("onreadystatechange didn�t go well!");
73
httpAjax.open('POST', servicename, true);
74
httpAjax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
76
// alert("Couldn�t open url.");
79
httpAjax.send(serviceparam);
81
// alert("Couldn�t send request.");
89
/*--------------------------------------------------------------------------------
92
This is the AJAX callback function. It detects the invoking service and handles
93
the reply from each service accordingly.
95
----------------------------------------------------------------------------------*/
99
if(httpAjax.readyState == 4){
101
str=httpAjax.responseText;
103
if(AJAXQueue.length>0){
104
var Aparam=AJAXQueue.pop();
105
var Aservice=AJAXQueue.pop();
106
AjaxServiceExec(Aservice,Aparam);
108
AJAXServiceRunning=false;
113
// If any other ready state than prepared, do nothing!
2
/*--------------------------------------------------------------------------------
4
----------------------------------------------------------------------------------*/
6
var ajaxQueue = new Array;
7
var ajaxServiceRunning = false;
11
/*--------------------------------------------------------------------------------
14
This is the only interface to the AJAX wrapper. This makes the ajax service
15
browser agnostic and provides a single interface for all of the services.
17
Each service uses a different url and a different parameter layout.
19
----------------------------------------------------------------------------------*/
20
function AjaxService(servicename, serviceparam) {
22
ajaxQueue.push(servicename);
23
ajaxQueue.push(serviceparam);
25
if(!ajaxServiceRunning) {
26
ajaxServiceRunning = true;
27
var aParam = ajaxQueue.pop();
28
var aService = ajaxQueue.pop();
29
ajaxServiceExec(aService, aParam);
33
/*--------------------------------------------------------------------------------
36
This is the only interface to the AJAX wrapper. This makes the ajax service
37
browser agnostic and provides a single interface for all of the services.
39
Each service uses a different url and a different parameter layout.
41
----------------------------------------------------------------------------------*/
42
function ajaxServiceExec(servicename, serviceparam) {
44
// Parameters are set, initiate AJAX engine
45
if (window.XMLHttpRequest) {
46
httpAjax = new XMLHttpRequest();
47
if (httpAjax.overrideMimeType) {
48
httpAjax.overrideMimeType('text/xml');
50
} else if(window.ActiveXObject) {
52
httpAjax = new ActiveXObject("Msxml2.XMLHTTP");
55
httpAjax = new ActiveXObject("Microsoft.XMLHTTP");
57
alert("Couldn�t build an AJAX instance.");
63
// Send request to Server and initiate callback.
65
httpAjax.onreadystatechange = getPage;
66
httpAjax.open('POST', servicename, true);
67
httpAjax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
68
httpAjax.send(serviceparam);
70
//alert("onreadystatechange didn�t go well!");
78
/*--------------------------------------------------------------------------------
81
This is the AJAX callback function. It detects the invoking service and handles
82
the reply from each service accordingly.
84
----------------------------------------------------------------------------------*/
87
if(httpAjax.readyState == 4) {
89
str = httpAjax.responseText;
91
if(ajaxQueue.length>0) {
92
var Aparam = ajaxQueue.pop();
93
var Aservice = ajaxQueue.pop();
94
ajaxServiceExec(Aservice, Aparam);
96
ajaxServiceRunning=false;
101
// If any other ready state than prepared, do nothing!