即使我使用了jquery的常规版本,我也有这个问题。
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="https://code.jquery.com/jquery-3.5.1.min.js"><\/script>')</script>html:
<button class="btn btn-secondary" type="button" id="save" onclick="save()">save</button>ajax函数:
function save(){
$.ajax() ({
type: 'POST',
url: 'file.php',
data: { name : name, content : content},
dataType: 'json'
});
}Uncaught:$.ajax(.)不是函数
。
发布于 2020-11-28 20:06:38
您尝试将ajax()作为函数执行,就像所以ajax() ({.})--这就是获得错误的原因。
尝试:
function save(){
$.ajax({
type: 'POST',
url: 'file.php',
data: { name : name, content : content},
dataType: 'json'
});
}https://stackoverflow.com/questions/65053761
复制相似问题