cookie的優(yōu)化與購(gòu)物車(chē)實(shí)例
719
2023-12-10
首先介紹get()函數(shù):
url,[data],[callback],[type]
參數(shù)說(shuō)明:
url:待載入頁(yè)面的URL地址
data:待發(fā)送 Key/value 參數(shù)。
callback:載入成功時(shí)回調(diào)函數(shù)。
type:返回內(nèi)容格式,xml, html, script, json, text, _default。
首先建立testGet.php實(shí)例:
<?php $web = $_GET['webname']; echo "你現(xiàn)在訪問(wèn)的網(wǎng)站是:".$web; ?>
然見(jiàn)建立ajax.html文件:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>php點(diǎn)點(diǎn)通 - 關(guān)注php開(kāi)發(fā),提供專(zhuān)業(yè)web開(kāi)發(fā)教程! </title> <script type="text/javascript" src="http://www.gimoo.net/t/1903/jquery-1.7.1.min.js"></script> <script> $(document).ready(function(){ $("#btn").click(function(){ $.get("testGet.php",{web:"www.phpddt.com"},function(data,textStatus){ $("#result").append("data:"+data); $("#result").append("<br>textStatus:"+textStatus); }); }); }); </script> </head> <body> <input type="button" value="測(cè)試" id="btn" /> <h2>顯示的內(nèi)容如下:</h2> <div id="result"></div> </body> </html>
測(cè)試前的初始頁(yè)面是:
點(diǎn)擊測(cè)試后的結(jié)果是:
#免責(zé)聲明#
本站[綠夏技術(shù)導(dǎo)航]提供的一切軟件、教程和內(nèi)容信息僅限用于學(xué)習(xí)和研究目的;不得將上述內(nèi)容用于商業(yè)或者非法用途,否則,一切后果請(qǐng)用戶自負(fù)。本站信息來(lái)自網(wǎng)絡(luò)收集整理,版權(quán)爭(zhēng)議與本站無(wú)關(guān)。您必須在下載后的24個(gè)小時(shí)之內(nèi),從您的電腦或手機(jī)中徹底刪除上述內(nèi)容。如果您喜歡該程序或內(nèi)容,請(qǐng)支持正版,購(gòu)買(mǎi)注冊(cè),得到更好的正版服務(wù)。我們非常重視版權(quán)問(wèn)題,如有侵權(quán)請(qǐng)郵件[admin@lxwl520.com]與我們聯(lián)系進(jìn)行刪除處理。敬請(qǐng)諒解!