File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,10 @@ OpenLayers.Format.WPSExecute = OpenLayers.Class(OpenLayers.Format.XML,
80
80
*/
81
81
write : function ( options ) {
82
82
var doc ;
83
- if ( window . ActiveXObject ) {
83
+ try {
84
84
doc = new ActiveXObject ( "Microsoft.XMLDOM" ) ;
85
85
this . xmldom = doc ;
86
- } else {
86
+ } catch ( e ) {
87
87
doc = document . implementation . createDocument ( "" , "" , null ) ;
88
88
}
89
89
var node = this . writeNode ( "wps:Execute" , options , doc ) ;
Original file line number Diff line number Diff line change @@ -81,8 +81,9 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
81
81
* the object.
82
82
*/
83
83
initialize : function ( options ) {
84
- if ( window . ActiveXObject ) {
84
+ try {
85
85
this . xmldom = new ActiveXObject ( "Microsoft.XMLDOM" ) ;
86
+ } catch ( e ) {
86
87
}
87
88
OpenLayers . Format . prototype . initialize . apply ( this , [ options ] ) ;
88
89
// clone the namespace object and set all namespace aliases
@@ -138,7 +139,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
138
139
* Since we want to be able to call this method on the prototype
139
140
* itself, this.xmldom may not exist even if in IE.
140
141
*/
141
- if ( window . ActiveXObject && ! this . xmldom ) {
142
+ if ( ! this . xmldom ) {
142
143
xmldom = new ActiveXObject ( "Microsoft.XMLDOM" ) ;
143
144
} else {
144
145
xmldom = this . xmldom ;
@@ -871,7 +872,7 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
871
872
if ( document . implementation && document . implementation . createDocument ) {
872
873
OpenLayers . Format . XML . document =
873
874
document . implementation . createDocument ( "" , "" , null ) ;
874
- } else if ( ! this . xmldom && window . ActiveXObject ) {
875
+ } else if ( ! this . xmldom ) {
875
876
this . xmldom = new ActiveXObject ( "Microsoft.XMLDOM" ) ;
876
877
}
877
878
}
You can’t perform that action at this time.
0 commit comments