Day Recipe Food Community



February 8, 2009

PHP + Jquery + Ajax auto refresh DIV

Filed under: miscellaneous — Tags: , , , — admin @ 10:21 pm

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.

  • Share/Bookmark

Related posts:

  1. PHP + Ajax auto refresh DIV
  2. Cheapest WordPress Web Hosting
  3. Flash slide show source download
  4. How to Post a Recipe on DayRecipe.Com [Tutorial]

3 Comments »

  1. 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?

    Comment by Ben Marshall — February 11, 2009 @ 4:07 pm

  2. setTimeout(‘ajax_update()’, 6000);

    just change the 6000 to 3000.

    Comment by admin — February 14, 2009 @ 4:58 am

  3. This code not working oo mozila broeser, is there any way to work on mozila also. pls help me

    Comment by Suresh — April 15, 2009 @ 6:22 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress