简体   繁体   中英

Cannot read property 'mode' of undefined

Very simple AJAX request, but it's not working at all. Getting this error i've never seen before:

Cannot read property 'mode' of undefined

$.ajax({
    url: '/Contractor/api/plot/LinkBuyer',
    method: 'POST',
    data: {
        'buyerId': 1,
        'plotId' : parseInt(sPlotId, 10),
        'activateDirectly': true
    },
    success: function (data) {
        console.log('success');
    },
    error: function(jqXHR, textStatus, errorThrown) {
        console.log(JSON.stringify(jqXHR));
        console.log("AJAX error: " + textStatus + ' : ' + errorThrown);
    }
});

Got the answer! I was using the slim version of jquery...

I had a very similar problem using jquery ui to show an hidden element.

jQuery('#myId').show({effect: 'Blind', duration: 800});

The problem is that the effect name is in lowercase, so the right line of javascript is

jQuery('#myId').show({effect: 'blind', duration: 800});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM