Ajax PHP refresh


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Ajax PHP refresh

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Ajax PHP refresh

    Hi I'm developing an instant messenger (AJAX/PHP/MYSQL) and I am currently working on a iframe which states if user is on/offline (the way this works is there is a field in the database which is default 'offline' which changes to 'online' when user logs in).
    The problem is that it (the iframe) currently uses Javascript and it flickers when it refreshes (att the text).
    I was wondering if there is an AJAX way so that it only updates when there is a change in the database rather than a set time (or a set time with no flicker), or a method with no iframe what-so-ever.
    If anybody has any advice that would be much appreciated, thank you.

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Welcome to DevX
    Quote Originally Posted by jasonmc View Post
    I was wondering if there is an AJAX way so that it only updates when there is a change in the database rather than a set time
    You would have to be constantly polling the database for a change in that field. How much traffic is that going to involve?

  3. #3
    Join Date
    Oct 2010
    Posts
    1
    Thanks very much for the reply ...there will not be a huge amount of traffic. I have been looking into an alternative way of doing it using an AJAX div refresh instead of an IFrame...with no joy as yet. I was hoping to have the AJAX pointing to the div and the PHP code in there to refresh every X seconds. Maybe I should open up a new thread or is that OK in here?
    Thanks again for the reply, much appreciated

Similar Threads

  1. Refrasing javascript ajax php question?
    By Hotelsincarmel in forum AJAX
    Replies: 0
    Last Post: 08-06-2010, 08:26 AM
  2. Php and ajax
    By sabinkumar in forum AJAX
    Replies: 0
    Last Post: 02-16-2009, 05:38 AM
  3. Ajax Refresh
    By neebski in forum AJAX
    Replies: 0
    Last Post: 08-10-2007, 08:17 PM
  4. AJAX, cURL, and PHP
    By chivkea in forum AJAX
    Replies: 0
    Last Post: 03-22-2007, 10:15 PM
  5. Replies: 0
    Last Post: 08-28-2006, 05:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center