parents() 方法返回被選元素的所有祖先元素,它一路向上直到文檔的根元素 (<html>)
2016-12-050個贊
children() 方法返回被選元素的所有直接子元素 find() 方法返回被選元素的后代元素,一路向下直到最后一個后代
2016-12-050個贊
next() 方法返回被選元素的下一個同胞元素 nextUntil() 方法返回介于兩個給定參數(shù)之間的所有跟隨的同胞元素。
2016-12-050個贊
選取首個 <div> 元素內(nèi)部的第一個 <p> 元素 $(document).ready(function(){ $("div p").first(); });
2016-12-050個贊
if (window.XMLHttpRequest){ // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else{ // code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
2016-12-050個贊
所屬章節(jié)課程:AJAX - 創(chuàng)建 XMLHttpRequest 對象
創(chuàng)建 XMLHttpRequest 對象的語法: variable=new XMLHttpRequest(); 老版本的 Internet Explorer (IE5 和 IE6)使用 ActiveX 對象: variable=new ActiveXObject("Microsoft.XMLHTTP");
2016-12-050個贊
所屬章節(jié)課程:jQuery - AJAX 簡介和方法
GET - 從指定的資源請求數(shù)據(jù)POST - 向指定的資源提交要處理的數(shù)據(jù) GET 基本上用于從服務(wù)器獲得(取回)數(shù)據(jù)。注釋:GET 方法可能返回緩存數(shù)據(jù)。 POST 也可用于從服務(wù)器獲取數(shù)據(jù)。不過,POST 方法不會緩存數(shù)據(jù),并且常用于連同請求一起發(fā)送數(shù)據(jù)。
2016-12-050個贊
所屬章節(jié)課程:AJAX - 向服務(wù)器發(fā)送請求
無法使用緩存文件(更新服務(wù)器上的文件或數(shù)據(jù)庫)向服務(wù)器發(fā)送大量數(shù)據(jù)(POST 沒有數(shù)據(jù)量限制)發(fā)送包含未知字符的用戶輸入時,POST 比 GET 更穩(wěn)定也更可靠
2016-12-050個贊
所屬章節(jié)課程:jQuery - noConflict() 方法
$.noConflict(); jQuery(document).ready(function(){ jQuery("button").click(function(){ jQuery("p").text("恭喜發(fā)財!"); }); });
2016-12-050個贊
服務(wù)端JSONP格式數(shù)據(jù) 如客戶想訪問 : http://ipnx.cn/try/ajax/jsonp.php?jsonp=callbackFunction。 假設(shè)客戶期望返回JSON數(shù)據(jù):["customername1","customername2"]。 真正返回到客戶端的數(shù)據(jù)顯示為: callbackFunction(["customername1","customername2"])。
2016-12-050個贊
所屬章節(jié)課程:AJAX - 服務(wù)器 響應(yīng)
$("body").html("<b>" + header + "</b><br/>" + description + "<br/><br/>" + "<a href=’" + sourceUrl + "'>Download the source files</a>";
2016-12-050個贊
所屬章節(jié)課程:AJAX - onreadystatechange 事件
function myFunction(){ loadXMLDoc("ajax_info.txt",function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }); }
2016-12-050個贊