我正在使用zend-framework,iframe,ajax和jquery在單擊DIV時調用url。使用Ajax和Jquery設置Iframe的目標?
我使用的iframe如下
<iframe src="http://localhost.test.com/public/index/listen-message" name="listenMsg" height="120" width="600">
<p>Your browser does not support iframes.</p>
</iframe>
我用以下爲DIV
<div target="listenMsg" class="text" id="<?php echo $row['id']; ?>">
......
</div>
而jQuery的我寫下面的代碼的代碼.....
$(".text").click(function()
{
var clickedDiv = $(this).attr("id");
var id=$(this).attr("id");
$.ajax({
type: "POST",
url: "http://localhost.test.com/public/index/listen-message",
data: id,
success: function(data){
}
});
return false;
});
但是,當我點擊DIV「文本」控件去http://localhost.test.com/public/index/listen-message,但結果不顯示在IFRAME ....?
什麼可能是可能的問題....?
請提供一些代碼,鏈接和想法......
在此先感謝......