[問題] JSON不能放變數嗎?

看板Ajax作者 (兔子)時間14年前 (2011/09/07 23:06), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我在寫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
文章代碼(AID): #1EPuXfF- (Ajax)
文章代碼(AID): #1EPuXfF- (Ajax)