[問題] JSON不能放變數嗎?
我在寫FB程式
以下是可以執行的
public function PassStage(stagecode) {
FB.ui(
{
method: 'stream.publish',
display: 'popup',//'dialog',
attachment: {
name: '<? echo $udata[name];?>破關了!',
caption: '大家一起挑戰看看',
href: 'http://apps.facebook.com/bombrabbit/?phpCode='
}
},
function(response) {
if(response && response.post_id){}else{}
}
);
}
但是在JSON中加了變數後就不能跑了
public function PassStage(stagecode) {
FB.ui(
{
method: 'stream.publish',
display: 'popup',//'dialog',
attachment: {
name: '<? echo $udata[name];?>破關了!',
caption: '大家一起挑戰看看',
href: 'http://apps.facebook.com/bombrabbit/?phpCode='+stagecode
}
},
function(response) {
if(response && response.post_id){}else{}
}
);
}
是不是有更正確的寫法?
請幫助我
感謝
--
◤ __ \__◣ ◢◤◢◤ ψhirabbitt
◢ ◤ ◢███◣ ◢███◣
http://ppt.cc/H~k, █████ █████ #1DttPzLe(Little-Games)
http://ppt.cc/FpAe ██●█● █▇███
http://ppt.cc/M9QS ██╱╲ ●◥█████◣● 怎麼增殖了=口=!?
為妳而做的遊戲 ◥╱█╱╱ ● ◥████ ˇ
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.42.99.108
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章