I played with .load () and .ajax (), but I did not get to the end. Here's what I need: Everey, the function should check if it can load a specific page. if the connection succeeds, I want to refresh the page; if not, nothing will happen, the script will try again later.
I am using jQueryTimers plugin. this is my code:
$(document).everyTime('60s', 'pagerefresh', reloadPage, 0, true);
function reloadPage() {
$.ajax({
url:'index-1.php',
type:'HEAD',
success: location.reload(true)
})
}
I do not know how to tell jQ what I want. Any hint was appreciated.
Steve source
share