Support » Plugin: Enable jQuery Migrate Helper » Javascript compatibility found with IE11 in this plugin

  • In js/deprecation-notice.js:

    function reportDeprecation( message ) {
    		// Do not write to the logfile if this is the backend and the notices are written to the screen.
    		if ( JQMH.backend && notice.length ) {
    			return;
    		}
    
    		if ( ! JQMH.capture_deprecations ) {
    			return;
    		}
    
    		let data = {
    			action: 'jquery-migrate-log-notice',
    			notice: message,
    			nonce: JQMH.report_nonce,
    			backend: JQMH.backend,
    			url: window.location.href,
    		};
    
    		$.post( {
    			url: JQMH.ajaxurl,
    			data
    		} );
    	}

    tail codes should be (supplement missing name for data)

    		$.post( {
    			url: JQMH.ajaxurl,
    			data: data
    		} );
    

    or ( use two args style )

    		$.post( 
    			JQMH.ajaxurl,
    			data
    		);
    

    In class-jquery-migrate-helper.php:

    				var match_pattern = /\)\.(.+?) is not a function/;
                    var erroredFunction = msg.match( match_pattern );
    
                    // If there was no matching functions, do not try to downgrade.
                    if ( typeof erroredFunction !== 'object' || typeof erroredFunction[1] === "undefined" || -1 === jQueryFunctions.indexOf( erroredFunction[1] ) ) {
                        return true;
                    }
    

    erroredFunction === null should be checked first, or erroredFunction is null if no matches, following condition check may not worked as expected, null is object, maybe unable to refer erroredFunction[1].

    Above issues are found with IE11, but may affect to others.

Viewing 1 replies (of 1 total)
  • Plugin Author Marius L. J.

    (@clorith)

    Hiya,

    Thanks for the bugreport for IE 11 here, you’re right that for IE11 users the JavaScript code doesn’t necessarily auto-pass the variable name as the object, so that needs to be fixed, and your catch of the null` value is also fantastic, thank you for that.

Viewing 1 replies (of 1 total)
  • The topic ‘Javascript compatibility found with IE11 in this plugin’ is closed to new replies.