PHP + Jquery + Ajax auto refresh DIV
February 8, 2009 in Ray by danke
jQuery is cool , Really !
Ajax.js
[source language='js']
var _v = 0;
var _v2 = 1;
function ajax_update()
{
var wrapperId = ‘#content’;
var postFile = ‘jquery.php’;
_v++;
_v2++;
$.post(postFile, { v2: _v2 , v: _v}, function(data){$(wrapperId).slideUp(‘2000′,function(){$(this).html(data).slideDown();}).html();});
setTimeout(‘ajax_update()’, 6000);
}
[/source]
check the demo here.
Download the script here.
Is there a way to make it go away after a certain number of seconds (like 3) and then after the 6 seconds it starts again?
setTimeout(‘ajax_update()’, 6000);
just change the 6000 to 3000.
This code not working oo mozila broeser, is there any way to work on mozila also. pls help me