我是新來的jQuery 3.以下是一個基本fiddle,使用jQuery以前版本的工作,但不使用jQuery 3jQuery的3苗條阿賈克斯基本的例子
$(function() {
$.ajax({
url: '/echo/json',
type: 'GET',
dataType: 'json',
success: function(data) {
console.log(data)
}
});
})
工作在控制檯中,我得到這個錯誤:
jquery-3.1.1.slim.min.js:2 jQuery.Deferred exception: $.ajax is not a function TypeError: $.ajax is not a function
jquery-3.1.1.slim.min.js:2 Uncaught TypeError: $.ajax is not a function(…)
爲什麼?
[剛剛看過了關於修改(https://jquery.com/upgrade-guide/3.0/#ajax) – GillesC
你有沒有用jQuery文件 –
連接@DavidJorHpan是當然的 –