Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE11 can't interpret window.ActiveXObject correctly anymore #1285

Closed
wants to merge 1 commit into from

Conversation

bkiselka
Copy link
Contributor

As in IE11 it is not possible to use window.ActiveXObject for checking for IE anymore (see http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx ), it is only possible to use a try-catch instead.

May be the intention of pull request #1210

As in IE11 it is not possible to use window.ActiveXObject for checking for IE anymore (see http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx ), it is only possible to use a try-catch instead.
bkiselka pushed a commit to bkiselka/ol2 that referenced this pull request Mar 25, 2014
I think I experience the same problem of issue openlayers#1177

As an example I modified the GetFeatureInfo example injecting the corrupt data that cause the error in IE11. Just click in the map.

Obviously the not valid HTML5 is can't be read with DomParser() in IE11.
One solution is pull request openlayers#1285

Another solution may be to check the INFO_FORMAT and do not call
var features = this.format.read(doc);
if it is text/html or text/plain (i.e. not a GML) as in showInfo() just the text is used (no GML features):
document.getElementById('responseText').innerHTML = evt.text;
@ahocevar
Copy link
Member

I'm happy to merge this, but I'll leave the final judgement to @bartvde. In the meantime, @bkiselka, can you please submit a CLA? Thanks.

@bartvde
Copy link
Member

bartvde commented Mar 25, 2015

no objection from me @ahocevar if @bkiselka can confirm relevant tests still pass after this change in major browsers

@szekerest
Copy link
Contributor

An alternative solution would be to use this check instead of the exception approach:

this.supportActiveX =
(Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(window, "ActiveXObject")) || ("ActiveXObject" in window);

then window.ActiveXObject can be replaced with this.supportActiveX in the expressions.

@ahocevar
Copy link
Member

I like that approach @szekerest. Would you be willing to create a pull request?

@szekerest
Copy link
Contributor

@ahocevar pull request sent
openlayers/openlayers#1439

@ahocevar
Copy link
Member

Fixed with #1439

@ahocevar ahocevar closed this Mar 25, 2015
bkiselka pushed a commit to bkiselka/ol2 that referenced this pull request Nov 25, 2016
I think I experience the same problem of issue openlayers#1177

As an example I modified the GetFeatureInfo example injecting the corrupt data that cause the error in IE11. Just click in the map.

Obviously the not valid HTML5 is can't be read with DomParser() in IE11.
One solution is pull request openlayers#1285

Another solution may be to check the INFO_FORMAT and do not call
var features = this.format.read(doc);
if it is text/html or text/plain (i.e. not a GML) as in showInfo() just the text is used (no GML features):
document.getElementById('responseText').innerHTML = evt.text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants