作者TonyQ (沉默是金。)
看板Ajax
标题Re: [ajax] $.post的data值
时间Mon Oct 11 00:38:00 2010
※ 引述《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
1F:推 vanillastarp:测试成功 感谢您的帮助! 10/11 12:47