matthew9090 Posted April 4, 2011 Share Posted April 4, 2011 iv'e looked at lots of code but none of them seem to work. i need to refresh the div tag in my page. <div id="div" name="div"> //content here </div> Link to comment https://forums.phpfreaks.com/topic/232640-reload-page/ Share on other sites More sharing options...
matthew9090 Posted April 4, 2011 Author Share Posted April 4, 2011 also i need to refresh it by a button. Link to comment https://forums.phpfreaks.com/topic/232640-reload-page/#findComment-1196562 Share on other sites More sharing options...
phpsycho Posted April 4, 2011 Share Posted April 4, 2011 <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#div').load(' FILE TO RELOAD ').fadeIn("slow"); }, 1000); // refresh every 1000 milliseconds </script> <div id="div" name="div"> </div> Link to comment https://forums.phpfreaks.com/topic/232640-reload-page/#findComment-1196699 Share on other sites More sharing options...
matthew9090 Posted April 5, 2011 Author Share Posted April 5, 2011 thats an auto refresh i need it to refresh when you click a button Link to comment https://forums.phpfreaks.com/topic/232640-reload-page/#findComment-1197043 Share on other sites More sharing options...
gizmola Posted April 5, 2011 Share Posted April 5, 2011 Ok, adapt what he provided by removing the setInterval() wrapper. Then specify this as the onClick() for your button. Link to comment https://forums.phpfreaks.com/topic/232640-reload-page/#findComment-1197056 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.