Hello everyone,
This has been driving me nuts for a few days. I am desperate for help.
I have 2 files, index.php and test.php, simplied version to follow.
index.php
<div id="div-hi"></div>
<div id="div-bye"></div>
<script>
$(document).ready(function(){ setInterval(function(){
$( function()
{
$.ajax(
{
url : 'test.php',
type : 'post',
success : function( resp )
{
$('#div-hi').html(resp);
$('#div-bye').html(resp);
}
});return false;}
);}, 1000);});
</script>
test.php
<div id="hi">
<script type="text/javascript">
---
</script>
</div>
<div id="bye">
<script type="text/javascript">
----
</script>
</div>
I want #div-hi in index.php to contain the result of my javascript from #hi from test.php and #div-bye from index.php to contain the result from #bye from test.php.
I have ran out of ideas. Please help.