2013-01-05 22 views
2

我目前在發出POST請求前收到錯誤Object #<Object> has no method 'toUpperCase',所以我希望並感謝您的幫助!由於錯誤:對象#<Object>沒有方法'toUpperCase'

function ajaxeo(url, data, method){ 
    $.ajax({ 
     url: url, 
     type: method, 
     data: data, 
     success: function(response){ 
      alert(response); 
     } 
    }); 
} 

function cambio(ID, newValue){ 
ajaxeo("includes/php/ajax/changeProvider.php?oldID="+ID, "post", {"newVal": newValue}); 
} 

var editable = $('div[contentEditable][dataAjax]'); 
for (var i=0, len = editable.length; i<len; i++){ 
    editable[i].setAttribute('data-orig',editable[i].innerHTML); 
    editable[i].onblur = function(){ 
     if (this.innerHTML == $(this).attr('data-orig')) { 
      // no change 
     } 
     else { 
      // change has happened, store new value 
      $(this).attr('data-orig', $(this).html()) 
      cambio($(this).attr('dataId'), $(this).html()); 
     } 
    }; 
} 

回答

1

你傳遞你的參數錯誤

ajaxeo("includes/php/ajax/changeProvider.php?oldID="+ID, "post", {"newVal": newValue}); 

應該

ajaxeo("includes/php/ajax/changeProvider.php?oldID="+ID, {"newVal": newValue}, "post"); 

的錯誤可能是jQuery的努力,以確保該方法是在大寫

+0

謝謝!我應該注意到它:B –

相關問題