wrathican Posted November 4, 2008 Share Posted November 4, 2008 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 Quote Link to comment Share on other sites More sharing options...
xtopolis Posted November 5, 2008 Share Posted November 5, 2008 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? Quote Link to comment Share on other sites More sharing options...
wrathican Posted November 7, 2008 Author Share Posted November 7, 2008 hey sorry for not replying sooner. Thanks for your reply, but I have since buggered everything up with that system and decided to take a new approach. No doubt i'll need help with that thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.