AJAX+PHP=refresh

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
matt1019
Forum Contributor
Posts: 172
Joined: Thu Jul 06, 2006 6:41 pm

AJAX+PHP=refresh

Post by matt1019 »

Hi everyone,

I would like to know if someone has found a way, or knows of a way to refresh a part of a page instead of the whole page using ajax.

Here's an example, in the cms I am currently using (phpfusion) there is a link to check new messages.... and I would like to update/refresh that particular part of the page only.... how can I employ AJAX in this way?


I used google, but no luck.... maybe because I am a lousy searcher?? (I used this sequence to search: "refresh+page+ajax")

any help is welcomed!


Thanks,

-Matt
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you can use dhtml to plug in anything sent back from the server (via ajax) to any portion of the page you want.

do a search for the innerHTML property.
User avatar
R4000
Forum Contributor
Posts: 168
Joined: Wed Mar 08, 2006 12:50 pm
Location: Cambridge, United Kingdom

Post by R4000 »

easy
use sajax or something or your own ajax code

Code: Select all

<div id="WHAT EVER">
part to change
</div>
and then when you get your ajax response

Code: Select all

var _gel = document.getElementById("WHAT EVER");
_gel.innerHTML = reposnseText;
:)
Post Reply