gpt4 book ai didi

javascript - 错误 : Object # has no method 'toUpperCase'
转载 作者:行者123 更新时间:2023-11-30 05:51:57 26 4
gpt4 key购买 nike

我目前收到错误 Object #<Object> has no method 'toUpperCase'在发出 POST 请求之前,非常感谢您的帮助!谢谢

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());
}
};
}

最佳答案

你传错了参数

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

应该是

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

错误可能是 jQuery 试图确保方法是大写的

关于javascript - 错误 : Object #<Object> has no method 'toUpperCase' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14169001/

26 4 0