author | Eugene Ostroukhov <eugeneo@symbian.org> |
Thu, 18 Mar 2010 11:56:59 -0700 | |
changeset 276 | f2f4a1259de8 |
parent 273 | b1f63c2c240c |
permissions | -rw-r--r-- |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
1 |
/** |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies). |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
3 |
* All rights reserved. |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
8 |
* |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
9 |
* Initial Contributors: |
273
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
11 |
* |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
12 |
* Contributors: |
273
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
13 |
* |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
14 |
* Description: |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
15 |
* |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
16 |
*/ |
73 | 17 |
|
18 |
/////////////////////////////////////////////////////////////////////////////// |
|
19 |
// Ajax utility calss to create XmlHttpRequest object |
|
20 |
function Ajax() |
|
21 |
{ |
|
22 |
// xmlHttpRequest object |
|
23 |
var request = null; |
|
24 |
||
25 |
// branch for native XMLHttpRequest object |
|
26 |
if(window.XMLHttpRequest && !(window.ActiveXObject)) { |
|
27 |
try |
|
28 |
{ |
|
29 |
request = new XMLHttpRequest(); |
|
30 |
try |
|
31 |
{ |
|
32 |
// attach the Bypass code, if the browser is firefox |
|
33 |
if(netscape.security.PrivilegeManager.enablePrivilege) |
|
34 |
{ |
|
35 |
// duplicate the function |
|
36 |
request._open = request.open; |
|
37 |
||
38 |
// redefine the function definition |
|
39 |
request.open = function(method, url, flag) |
|
40 |
{ |
|
41 |
try |
|
42 |
{ |
|
43 |
// Enable Universal Browser Read |
|
44 |
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); |
|
45 |
||
46 |
// call the native XmlHttpRequest.open method |
|
47 |
this._open(method, url, flag); |
|
48 |
}catch(e) |
|
49 |
{ |
|
50 |
// call the native XmlHttpRequest.open method |
|
51 |
this._open(method, url, flag); |
|
52 |
} |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
53 |
}; |
73 | 54 |
} |
55 |
} |
|
56 |
catch(e) |
|
57 |
{ |
|
58 |
// eatup all exceptions |
|
59 |
} |
|
60 |
} |
|
61 |
catch(e) { |
|
62 |
request = null; |
|
63 |
} |
|
64 |
// branch for IE/Windows ActiveX version |
|
65 |
} else if(window.ActiveXObject) { |
|
66 |
try { |
|
67 |
request = new ActiveXObject("Msxml2.XMLHTTP"); |
|
68 |
} catch(e) { |
|
69 |
try { |
|
70 |
request = new ActiveXObject("Microsoft.XMLHTTP"); |
|
71 |
} catch(e) { |
|
72 |
alert('Failed to create XmlHttprequest'); |
|
73 |
return null; |
|
74 |
} |
|
75 |
} |
|
76 |
} |
|
77 |
||
78 |
return (request); |
|
79 |
} |