desc就是用於查詢出結果時候對結果進行排序,是降序排序,而asc就是升序。。要用與order by一起用。
例如select * from student order by id desc; 就是把選出的結果經過“按id從大到小排序”後
----- async: false, true
當async: true 時,ajax請求是異步的。但是其中有個問題:testAsync()中的ajax請求和其後面的操作是異步執行的,那麼當tet.php還未執行完,就可能已經執行了 ajax請求後面的操作,
如: alert(temp+' end');
然而,temp這個數據是在ajax請求success後才賦值的,結果,輸出時會爲空。
function testAsync(){
var temp;
$.ajax({
async: false,
type : "GET",
url : 'tet.php',
complete: function(msg){
alert('complete');
},
success : function(data) {
alert('success');
temp=data;
}
});
alert(temp+' end');
}