我有一個變量$ visitRecord-> getReferallist(),它獲取數組中的醫生列表。我需要將數組發送到一個PHP文件,並在PHP文件做foreach動作..我如何發送這個數組變量在jQuery中。此代碼無效。使用jquery發送數組
function seekOpinion()
{
var queryUrl = "<?php echo $this->url(array('controller' => 'consultant', 'action' =>'opiniondoclist'));?>";
$.post(queryUrl,{referal:'<?php echo $gotreferal; ?>',visitId:'<?php echo $gotvisitId; ?>',referalList:'<?php echo $visitRecord->getReferallist(); ?>'},function(data)
{
$('.opiniondoclistData').html(data);
});
document.getElementById('opiniondoclistDiv').style.display = "";
}
生成的HTML看起來像什麼? – 2010-07-26 09:56:43
@MilanBabuškov - 我在格式化。但我需要在後端php正確地獲取數組。當我說打印 回聲$ _POST ['referalList']在輿情名單。它只是打印陣列。沒有別的... – Hacker 2010-07-26 10:00:43