php - Setting target for Iframe using Ajax and Jquery? -
i using zend-framework, iframe, ajax , jquery call url when div clicked.
i using iframe follow
<iframe src="http://localhost.test.com/public/index/listen-message" name="listenmsg" height="120" width="600"> <p>your browser not support iframes.</p> </iframe>
i used following code div
<div target="listenmsg" class="text" id="<?php echo $row['id']; ?>"> ...... </div>
and jquery write following code.....
$(".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; });
but when click div "text" control goes http://localhost.test.com/public/index/listen-message result not shown in iframe....?
what may possible problems....?
please provide code, links , ideas......
thanks in advance......
+1 answer - although there error in code:
$('iframe[name="listenmsg"]').contents().find("body").html("your message");
Comments
Post a Comment