的控制器這是我已經包含在HEAD標記自己的JavaScript函數:發送數據通過JSON(AJAX功能),但不能訪問
function test()
{
//enter code here
$.ajax({
url: 'test?msgto='+document.getElementById('Select1').value,
dataType: 'json',
type : 'GET',
success: function(result)
{
// console.log(result);
alert('test1');
// alert(string(result[0]['Select1']));
// alert(result[0]['TextArea1']);
//document.getElementById('Text1').Value = ;// string(result[0]['location']);
}
});
}
,我想將數據發送到我的PHP控制器在按鈕的Cilck事件上使用此功能。我寫了下面的代碼的getAction()
// TODO Auto-generated method stub
//echo('Get');
$msgfrom = 1; //$this->_getparam('usrid');
$msgto = $this->_getparam('msgto');
$sql = "call select_messages(".$msgfrom.",".$msgto.");";
$data = Zend_Db_Table::getDefaultAdapter()->query($sql)->fetchAll();
$this->_helper->json($data);
不過,雖然上點擊我沒有得到任何輸出或結果.... 請儘快引導我..... :)
什麼是HTML的樣子。你可以張貼其中的一部分陳述Select1。行動的路徑應該是相對的/測試/?可以這是一個問題 – 2012-02-13 10:44:27