亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么點擊保存沒有反應,alert里面的內容都沒彈出來

<!DOCTYPE html>

<html>

? ? <head>

? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

? ? ? ? <script src="https://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>

? ? ? ? <title>挑戰題</title>

? ? </head>

? ? <body>

? ? ? ? <input id="username" type="text" name="" />

? ? ? ? <input id="age" type="text" name="" />

? ? ? ? <input id="save" type="button" value="保存"/>

? ? ? ? <input id="show" type="button" value="顯示"/>

? ? ? ? <ul></ul>

? ? ? ? <script type="text/javascript">

? ? ? ? ? ? $(function(){

? ? ? ? ? ? ? ? var json=[];

? ? ? ? ? ? ? ? $("#save").bind("click",function(){

? ? ? ? ? ? ? ? ? ? alert("保存");

? ? ? ? ? ? ? ? ? ? json.push({

? ? ? ? ? ? ? ? ? ? ? ??

? ? ? ? ? ? ? ? ? ? ? ? "username":$("#username").val(),

? ? ? ? ? ? ? ? ? ? ? ? "age":$("#age").val()

? ? ? ? ? ? ? ? ? ? });

? ? ? ? ? ? ? ? ? ? $("#username").val("");

? ? ? ? ? ? ? ? ? ? $("#age").val("");

? ? ? ? ? ? ? ? });

? ? ? ? ? ? ? ? $("#show").bind("click",function(){

? ? ? ? ? ? ? ? ? ? $.each(json,function(i){

? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>"+json[i].username+json[i].age"</li><br>")

? ? ? ? ? ? ? ? ? ? })

? ? ? ? ? ? ? ? });

? ? ? ? ? ? })

? ? ? ? </script>

? ? </body>

</html>


正在回答

1 回答

<!DOCTYPE html>


<html>


? ? <head>


? ? ? ? <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


? ? ? ? <script src="https://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>


? ? ? ? <title>挑戰題</title>


? ? </head>


? ? <body>


? ? ? ? <input id="username" type="text" name="" />


? ? ? ? <input id="age" type="text" name="" />


? ? ? ? <input id="save" type="button" value="保存"/>


? ? ? ? <input id="show" type="button" value="顯示"/>


? ? ? ? <ul></ul>


? ? ? ? <script type="text/javascript">


? ? ? ? ? ? $(function(){


? ? ? ? ? ? ? ? var json=[];


? ? ? ? ? ? ? ? $("#save").bind("click",function(){


? ? ? ? ? ? ? ? ? ? alert("保存");


? ? ? ? ? ? ? ? ? ? json.push({


?? ? ? ? ? ? ? ? ? ? ? ?


? ? ? ? ? ? ? ? ? ? ? ? "username":$("#username").val(),


? ? ? ? ? ? ? ? ? ? ? ? "age":$("#age").val()


? ? ? ? ? ? ? ? ? ? });


? ? ? ? ? ? ? ? ? ? $("#username").val("");


? ? ? ? ? ? ? ? ? ? $("#age").val("");


? ? ? ? ? ? ? ? });


? ? ? ? ? ? ? ? $("#show").bind("click",function(){


? ? ? ? ? ? ? ? ? ? $.each(json,function(i){


? ? ? ? ? ? ? ? ? ? ? ? $("ul").append("<li>"+json[i].username+json[i].age+"</li><br>");


? ? ? ? ? ? ? ? ? ? })


? ? ? ? ? ? ? ? });


? ? ? ? ? ? })


? ? ? ? </script>


? ? </body>


</html>

?$("ul").append("<li>"+json[i].username+json[i].age+"</li><br>");少了一個分號,一個加號


0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
jQuery基礎(五)一Ajax應用與常用插件
  • 參與學習       69101    人
  • 解答問題       416    個

如何用jquery實現ajax應用,加入學習,有效提高前端開發速度

進入課程

為什么點擊保存沒有反應,alert里面的內容都沒彈出來

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號