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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.