Re: [ajax] $.post的data值

看板Ajax作者 (沉默是金。)時間15年前 (2010/10/11 00:38), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《vanillastarp (小皮)》之銘言: : 請問 : function edit(number){ : var list = '{Number:'+number+'}'; : $.post("data.php?pages=10",list,function(data){ : $("#content").html(data); : }); : } : 這樣的寫法要怎樣寫才能使用? : post的data值好像不能由變數決定 : 請幫忙解答  謝謝 那就只是一個 javascript object 呀~ 以你的需求來講,可以寫成 --- var list = {}; list["number"]= number; $.post("data.php?pages=10",list,function(data){ --- -- I am a person, and I am always thinking . Thinking in love , Thinking in life , Thinking in why , Thinking in worth. I can't believe any of what , I am just thinking then thinking , but worst of all , most of mine is thinking not actioning... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.71.122.74

10/11 12:47, , 1F
測試成功 感謝您的幫助!
10/11 12:47, 1F
文章代碼(AID): #1CiUlhKG (Ajax)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #1CiUlhKG (Ajax)