Re: [ajax] $.post的data值
※ 引述《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
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章