2
/*--------------------------------------------------------------------------------
4
----------------------------------------------------------------------------------*/
6
var AJAXQueue = new Array;
7
var AJAXServiceRunning=false;
8
var AJAXReturnfunction;
12
function getSVG(fileName){
13
paramstr="svgname="+escape(fileName);
14
AjaxService("SVG_TO_CANVAS_III.php",paramstr,"returnedSVG");
17
/*--------------------------------------------------------------------------------
20
This is the only interface to the AJAX wrapper. This makes the ajax service
21
browser agnostic and provides a single interface for all of the services.
23
Each service uses a different url and a different parameter layout.
25
----------------------------------------------------------------------------------*/
27
function AjaxService(servicename,serviceparam,returnfunction){
29
AJAXQueue.push(servicename);
30
AJAXQueue.push(serviceparam);
31
AJAXQueue.push(returnfunction);
33
if(!AJAXServiceRunning){
34
AJAXServiceRunning=true;
35
AJAXReturnfunction=AJAXQueue.pop();
36
var Aparam=AJAXQueue.pop();
37
var Aservice=AJAXQueue.pop();
38
AjaxServiceExec(Aservice,Aparam);
42
/*--------------------------------------------------------------------------------
45
This is the only interface to the AJAX wrapper. This makes the ajax service
46
browser agnostic and provides a single interface for all of the services.
48
Each service uses a different url and a different parameter layout.
50
----------------------------------------------------------------------------------*/
52
function AjaxServiceExec(servicename,serviceparam){
54
// Parameters are set, initiate AJAX engine
55
if (window.XMLHttpRequest) {
56
httpAjax = new XMLHttpRequest();
57
if (httpAjax.overrideMimeType) {
58
httpAjax.overrideMimeType('text/xml');
60
}else if(window.ActiveXObject){
62
httpAjax = new ActiveXObject("Msxml2.XMLHTTP");
65
httpAjax = new ActiveXObject("Microsoft.XMLHTTP");
67
alert("Couldn�t build an AJAX instance.");
73
// Send request to Server and initiate callback.
76
httpAjax.onreadystatechange = getPage;
78
alert("onreadystatechange didn�t go well!");
81
httpAjax.open('POST', servicename, true);
82
httpAjax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
84
alert("Couldn�t open url.");
87
httpAjax.send(serviceparam);
89
alert("Couldn�t send request.");
97
/*--------------------------------------------------------------------------------
100
This is the AJAX callback function. It detects the invoking service and handles
101
the reply from each service accordingly.
103
----------------------------------------------------------------------------------*/
107
if(httpAjax.readyState == 4){
109
str=httpAjax.responseText;
110
eval(AJAXReturnfunction+'(str);');
112
if(AJAXQueue.length>0){
113
AJAXReturnfunction=AJAXQueue.pop();
114
var Aparam=AJAXQueue.pop();
115
var Aservice=AJAXQueue.pop();
116
AjaxServiceExec(Aservice,Aparam);
118
AJAXServiceRunning=false;
123
// If any other ready state than prepared, do nothing!
1
/*--------------------------------------------------------------------------------
3
----------------------------------------------------------------------------------*/
5
var AJAXQueue = new Array;
6
var AJAXServiceRunning = false;
7
var AJAXReturnfunction;
10
function getSVG(fileName) {
11
paramstr = "svgname=" + escape(fileName);
12
AjaxService("SVG_TO_CANVAS_III.php", paramstr, "returnedSVG");
15
/*--------------------------------------------------------------------------------
18
This is the only interface to the AJAX wrapper. This makes the ajax service
19
browser agnostic and provides a single interface for all of the services.
21
Each service uses a different url and a different parameter layout.
23
----------------------------------------------------------------------------------*/
25
function AjaxService(servicename, serviceparam, returnfunction) {
27
AJAXQueue.push(servicename);
28
AJAXQueue.push(serviceparam);
29
AJAXQueue.push(returnfunction);
31
if(!AJAXServiceRunning) {
32
AJAXServiceRunning = true;
33
AJAXReturnfunction = AJAXQueue.pop();
34
var Aparam = AJAXQueue.pop();
35
var Aservice = AJAXQueue.pop();
36
AjaxServiceExec(Aservice, Aparam);
40
/*--------------------------------------------------------------------------------
43
This is the only interface to the AJAX wrapper. This makes the ajax service
44
browser agnostic and provides a single interface for all of the services.
46
Each service uses a different url and a different parameter layout.
48
----------------------------------------------------------------------------------*/
50
function AjaxServiceExec(servicename, serviceparam) {
51
// Parameters are set, initiate AJAX engine
52
if(window.XMLHttpRequest) {
53
httpAjax = new XMLHttpRequest();
54
if(httpAjax.overrideMimeType) {
55
httpAjax.overrideMimeType('text/xml');
57
} else if(window.ActiveXObject) {
59
httpAjax = new ActiveXObject("Msxml2.XMLHTTP");
62
httpAjax = new ActiveXObject("Microsoft.XMLHTTP");
64
alert("Couldn�t build an AJAX instance.");
70
// Send request to Server and initiate callback.
72
httpAjax.onreadystatechange = getPage;
74
alert("onreadystatechange didn�t go well!");
77
httpAjax.open('POST', servicename, true);
78
httpAjax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
80
alert("Couldn�t open url.");
83
httpAjax.send(serviceparam);
85
alert("Couldn�t send request.");
91
/*--------------------------------------------------------------------------------
94
This is the AJAX callback function. It detects the invoking service and handles
95
the reply from each service accordingly.
97
----------------------------------------------------------------------------------*/
100
if(httpAjax.readyState == 4) {
101
str=httpAjax.responseText;
102
eval(AJAXReturnfunction + '(str);');
103
if(AJAXQueue.length > 0) {
104
AJAXReturnfunction = AJAXQueue.pop();
105
var Aparam = AJAXQueue.pop();
106
var Aservice = AJAXQueue.pop();
107
AjaxServiceExec(Aservice, Aparam);
109
AJAXServiceRunning = false;
113
// If any other ready state than prepared, do nothing!