[問題]抓不到json的值

看板Ajax作者 (技術時代)時間14年前 (2009/11/24 06:14), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
請問一下 我正在練習抓用jQuery Form Plugin 抓json的值 可是怎麼抓都抓不到 試了好久 跟官網提供的範例也沒差 實在不知道為何抓不到 可以幫忙幫我看一下哪裡有寫錯嗎?? script方面: <script src="jquery-1.3.1.js" type="text/javascript"></script> <script src="jquery.form.js" type="text/javascript"></script> <script> $(document).ready(function() { $('#form1').ajaxForm({ dataType:"json", success:function(data){ $('#aa').html(data.name); } }); }); </script> 表單: <form id="form1" name="form1" method="post" action="test.jsp"> name: <input type="text" name="name" id="textfield" /> <input type="submit" name="button" id="button" value="送出" /> </form> <div id="aa"></div> text.jsp : <% request.setCharacterEncoding("utf-8"); String name=request.getParameter("name"); out.println("{'name' : '"+name+"' }"); %> 可以幫我看一下嗎? 實在不知道錯在哪?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.110.83.12

11/25 09:23, , 1F
自推一下 耍笨= = jsp忘了去掉html相關標籤
11/25 09:23, 1F
文章代碼(AID): #1B2mb4tp (Ajax)