I am loading ajax response to div but now i want to load it to middle iframe i tried the following but it never work! could you guys tell me what i am doing wrong ? Thanks
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$.ajaxSetup({ cache: false });
setInterval(function() {
//$('#divToRefresh').load('./doit.php');
$("#iframe").attr('blank.php','./doit.php'); //change url
}, 20000);
});
// ]]></script>
<iframe name="top" src="blank.php" id="top" scrolling="no" noresize frameborder="0" marginwidth="0" marginheight="0" width="100%" height="79"></iframe>
<iframe NAME="middle" src="blank.php" id="middle" noresize frameborder="0" marginwidth="0" marginheight="0" width="100%" height="238" scrolling="auto"></iframe>
<iframe NAME="foot" src="blank.php" id="foot" scrolling="no" noresize frameborder="0" marginwidth="0" marginheight="0" width="100%" height="200"></iframe>
<div id="divToRefresh">Loading ...</div>
The attr is used to replace an attribute, you are not stating which attribute to replace you are stating the value of that attribute
it should be something like:
However this is not ajax… it is plain simple iframe technique
in other words the $.ajaxSetup({ cache: false }); is not used in this case.