service.js
924 Bytes
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
if (typeof (nBildertool) === 'undefined')
nBildertool = {};
nBildertool.req = null;
nBildertool.service = function (url, callback)
{
// erstellen des requests
try
{
nBildertool.req = new XMLHttpRequest();
}
catch (e)
{
try
{
nBildertool.req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
nBildertool.req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (failed)
{
nBildertool.req = null;
}
}
}
if (nBildertool.req == null)
alert("Error creating request object!");
nBildertool.req.open("GET", url, true);
// Beim abschliessen des request wird diese Funktion ausgeführt
if (typeof (callback) === 'undefined')
nBildertool.req.onreadystatechange = nBildertool.cbCommon;
else
nBildertool.req.onreadystatechange = callback;
nBildertool.req.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
nBildertool.req.send(null);
}