Parameters: {"celebration"=>{"friend_details"=>"[{\"name\":\"Mitchell Gould\",\"fbuid\":\"751640040\",\"picUrl\":\"http://graph.facebook.com/751640040/picture\",\"birthday\":\"10/07/1967\"},{\"name\":\"Anthony Rosenfeld\",\"fbuid\":\"692130342\",\"picUrl\":\"http://graph.facebook.com/692130342/picture\",\"birthday\":\"12/09\"}]", "manager_details"=>"[{\"name\":\"Mitchell Gould\",\"fbuid\":\"751640040\",\"picUrl\":\"http://graph.facebook.com/751640040/picture\",\"birthday\":\"10/07/1967\"}]"}}
提出された値でこれらの "\"が表示されているようです。それらが私のオブジェクトに追加されないようにするにはどうすればいいですか?ここで送信時にJSONオブジェクトに余分な ""を付ける
は、私は、オブジェクトを作る方法です。
json_details.push({name: fb.name, fbuid: fb.id, picUrl: pic_url, birthday: fb.birthday });
var friend_details = JSON.stringify(json_details);
は、その後、私は隠しフィールドとしてフォームでこれを渡す:
html += "<input type='hidden' id='manager' value='"+manager_details +"' name='celebration[manager_details]' />"
あなたのphpはmagic_quotes_gpcで有効になっていますか? – ajreal
バックスラッシュは、データを印刷する方法のアーティファクトかもしれません。あなたは "' Parameters:... '"ビットを表示するために何を使用していますか? – duskwuff