Jump to content

Auto updating content


wrathican

Recommended Posts

hey people,

ive made an OOP PHP CMS, and I have decided to add ajaxfunctionality to it. I have used a template class to handle to layout of pages

 

my page layout has a form for the page content and a list of pages already created.

the only problem is when the user creates a page I need the list of created pages to update too. it thought that this might be best aceivable by running a periodic update, but i guess it would be best to use an update function that runs on readystatechange, when it equals 4.

 

now because i used a templating class i dont have a specific php method/script to get data from a database and set the layout. how would i go about updating this list of created pages?

 

Thanks

Wrathican

Link to comment
https://forums.phpfreaks.com/topic/131360-auto-updating-content/
Share on other sites

You can just use the same improper method that's been widely adopted:

 

change the innerHTML of an object, such as a div, or UL, depending on your layout.  send an AJAX request, receive the result in plain text or XML, modify the client side code to reflect your changes.  Best if done properly with DOM createElement/node, but commonly done with element.innerHTML =  ...

 

Is this what you're asking?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.