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} * @returns {XMLHttpRequest}
*/ */
createAjaxRequest: function( local ) { 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 ) { if ( window.XMLHttpRequest ) {
$.createAjaxRequest = function( local ) { $.createAjaxRequest = function( local ) {
if ( local ) { if ( local ) {
/* global ActiveXObject:true */
return new ActiveXObject( "Microsoft.XMLHTTP" ); return new ActiveXObject( "Microsoft.XMLHTTP" );
} }
return new XMLHttpRequest(); return new XMLHttpRequest();
@ -2001,12 +2011,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
}; };
var ACTIVEX = [ var FILEFORMATS = {
"Msxml2.XMLHTTP",
"Msxml3.XMLHTTP",
"Microsoft.XMLHTTP"
],
FILEFORMATS = {
"bmp": false, "bmp": false,
"jpeg": true, "jpeg": true,
"jpg": true, "jpg": true,