r112792 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112791‎ | r112792 | r112793 >
Date:11:12, 1 March 2012
Author:jdlrobson
Status:ok
Tags:
Comment:
check for overrideMimeType before using it

this is a non-standard function so some browsers
will not support it... blackberry 9300 for instance
Modified paths:
  • /trunk/extensions/MobileFrontend/javascripts/application.js (modified) (history)
  • /trunk/extensions/MobileFrontend/javascripts/beta_application.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/javascripts/beta_application.js
@@ -140,7 +140,9 @@
141141 } else {
142142 xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
143143 }
144 - xmlHttp.overrideMimeType( 'text/xml' );
 144+ if( xmlHttp.overrideMimeType ) { // non standard
 145+ xmlHttp.overrideMimeType( 'text/xml' );
 146+ }
145147 xmlHttp.onreadystatechange = function() {
146148 if ( xmlHttp.readyState === 4 && xmlHttp.status === 200 ) {
147149 options.success( xmlHttp.responseXML );
Index: trunk/extensions/MobileFrontend/javascripts/application.js
@@ -135,7 +135,9 @@
136136 } else {
137137 xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
138138 }
139 - xmlHttp.overrideMimeType( 'text/xml' );
 139+ if( xmlHttp.overrideMimeType ) { // non standard
 140+ xmlHttp.overrideMimeType( 'text/xml' );
 141+ }
140142 xmlHttp.onreadystatechange = function() {
141143 if ( xmlHttp.readyState === 4 && xmlHttp.status === 200 ) {
142144 options.success( xmlHttp.responseXML );

Status & tagging log