Test if activex is available by trying to create one for ie11 compatibility.

This commit is contained in:
Antoine Vandecreme 2014-04-17 17:20:04 -04:00
parent 3b4dca329d
commit 116cf7449f

View File

@ -1748,11 +1748,21 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
* @returns {XMLHttpRequest}
*/
createAjaxRequest: function( local ) {
if ( window.ActiveXObject ) {
// IE11 does not support window.ActiveXObject so we just try to
// create one to see if it is supported.
// See: http://msdn.microsoft.com/en-us/library/ie/dn423948%28v=vs.85%29.aspx
var supportActiveX;
try {
/* global ActiveXObject:true */
supportActiveX = !!new ActiveXObject( "Microsoft.XMLHTTP" );
} catch( e ) {
supportActiveX = false;
}
if ( supportActiveX ) {
if ( window.XMLHttpRequest ) {
$.createAjaxRequest = function( local ) {
if ( local ) {
/* global ActiveXObject:true */
return new ActiveXObject( "Microsoft.XMLHTTP" );
}
return new XMLHttpRequest();
@ -2001,12 +2011,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
};
var ACTIVEX = [
"Msxml2.XMLHTTP",
"Msxml3.XMLHTTP",
"Microsoft.XMLHTTP"
],
FILEFORMATS = {
var FILEFORMATS = {
"bmp": false,
"jpeg": true,
"jpg": true,