I have a div tag that contains php to populate this div with information; I want to make the page invoked every 15 seconds so that it can update the information there without reloading the entire web page. I tried to do this using JavaScript / jQuery and I just can't get it to work.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript"> var auto_refresh = setInterval( function () { $('.View').load('Small.php').fadeIn("slow"); }, 15000); </script> <div class="View"><?php include 'Small.php'; ?></div>
this is what I got after the search, and what happens, it loads Small.php, but does not update it or does not update the information every 15 seconds.
Please, help!
I have to add all my php arrays that should be displayed, they all execute in Small.php, and the page that I include is simply isolated.
EDIT: what no one noticed was that my first jQuery script link did not have a closing tag, and that broke my second script. after adding to the correct closing tag, finally the script worked, but fadeIn does not display properly without using fadeOut first.
javascript jquery html ajax php
Fat averie
source share