第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

JSONP測(cè)試

<!--
JSONP由回調(diào)函數(shù)和數(shù)據(jù)組成
通過查詢字符串指定當(dāng)響應(yīng)到來時(shí)在頁面中調(diào)用的函數(shù)
可以直接訪問響應(yīng)文本,實(shí)現(xiàn)雙向通信,不過無法保證響應(yīng)內(nèi)容的安全性
-->
<!DOCTYPE?html>
<html>
<head>
<meta?charset="UTF-8">
<title>跨域--jsonp--百度搜索</title>
<style?type="text/css">
????html,body,div,input,ul,li,a{
????margin:?0;
????padding:?0;
????}
????
????#baiduSearch{
????position:?absolute;
????top:?10px;
????}
????
????#baiduSearch{
????left:?100px;
????}
????
????#baiduSearch?input{
????????width:?300px;
????????height:?30px;
????????padding:?5px;
????????border:?1px?solid?#F90;
????????font-size:?16px;
????}
????
????#baiduSearch?ul{
????????display:?none;
????????width:?310px;
????????border:?1px?solid?#F90;
????}
????
????#baiduSearch?li{
????????list-style:?none;
????}
????
????#baiduSearch?li?a{
????????padding:?5px;
????????text-decoration:?none;
????????line-height:?30px;
????????color:?#000;
????}
????
????#baiduSearch?li?a:hover{
????????display:?block;
????????color:?#FFF;
????????background-color:?#F90;
????}
</style>
</head>
<body>
????<div?id="baiduSearch">
????????<input?type="text"?value=""?name="q"?placeholder="百度搜索">
????????<ul></ul>
????</div>
<script?type="text/javascript">
????var?oBaidu?=?document.getElementById("baiduSearch");
????var?baiduSearch?=?oBaidu.getElementsByTagName("input")[0];
????var?baiduList?=?oBaidu.getElementsByTagName("ul")[0];
????
????function?baiduSug(data)?{
????????var?html?=?"";
????????
????????if?(data.s.length)?{
????????????baiduList.style.display?=?"block";
????????????for?(var?i=0;?i<data.s.length;?i++)?{
????????????????html?+=?"<li><a?target='_blank'?;
????????????};
????????????baiduList.innerHTML?=?html;
????????}?else?{
????????????baiduList.style.display?=?"none";
????????};
????}
????
????baiduSearch.onkeyup?=?function?()?{
????????if?(this.value?!=?"")?{
????????????var?oScript?=?document.createElement("script");
????????????oScript.src?=?"http://suggestion.baidu.com/su?cb=baiduSug&wd="+this.value;
????????????if?(document.body)?{
????????????????document.body.appendChild(oScript);
????????????}?else?{
????????????????document.documentElement.appendChild(oScript);
????????????};
????????}?else?{
????????????baiduList.style.display?=?"none";
????????};
????}
</script>
</body>
</html>
</body>
</html>


正在回答

4 回答

$_GET[cb].'({jsondata})'

0 回復(fù) 有任何疑惑可以回復(fù)我~

oScript.src?=?"http://suggestion.baidu.com/su?cb=baiduSug&wd="+this.value;

在后臺(tái)是如何處理cb=baiduSug?來實(shí)現(xiàn)調(diào)用js baiduSug這個(gè)函數(shù)的?

0 回復(fù) 有任何疑惑可以回復(fù)我~

在Java端,我的返回值格式是怎么樣的?


0 回復(fù) 有任何疑惑可以回復(fù)我~

本來以為是問題,結(jié)果我把代碼看了一遍后,發(fā)現(xiàn)你理解的這么透徹,反而自己受益匪淺呀!

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

學(xué)之舟_36820 提問者

有所幫助就好
2016-11-07 回復(fù) 有任何疑惑可以回復(fù)我~
#2

學(xué)之舟_36820 提問者

有所幫助就好
2016-11-07 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Ajax全接觸
  • 參與學(xué)習(xí)       224774    人
  • 解答問題       708    個(gè)

本課程通過一個(gè)案例,講解Ajax的相關(guān)概念原理實(shí)現(xiàn)方式和應(yīng)用

進(jìn)入課程
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)