Log in

View Full Version : Ajax dynamic content



nicksalad
03-23-2009, 11:11 PM
Hi,

I'm trying to make my site more dynamic, its all php with connections to mssql to retrieve data, now, i would like to make it to won't refresh the whole page when i click a link or submit a form or whatever, i would like to only refresh a part of the page, lets say the content, the header, menu and footer won't change.

I saw this: http://www.dhtmlgoodies.com/scripts/ajax-dynamic-content/ajax-dynamic-content.html

but doesn't seem to do what i want, whenever i submit a form on the content div, or press a link or whatever, it refreshes the whole page, i need smth that whatever i do on that content div, it will only affect that div, and not the rest of the page.

BTW. Here's an example: http://www.darksideofmu.com/
Check how only the content (middle part of the site) changes when moving thru the site and the rest of the site, header, menu, footer, etc, stays the same.

Thank you.

Medyman
03-24-2009, 01:44 PM
I'd suggest looking into jQuery (http://jquery.com/), the jQuery form plugin (http://malsup.com/jquery/form/)and the jQuery AJAX API (http://docs.jquery.com/Ajax).

The form plugin will do almost all of the heavy lifting in the case of submitting forms.

nicksalad
03-24-2009, 10:58 PM
I'd suggest looking into jQuery (http://jquery.com/), the jQuery form plugin (http://malsup.com/jquery/form/)and the jQuery AJAX API (http://docs.jquery.com/Ajax).

The form plugin will do almost all of the heavy lifting in the case of submitting forms.

Thanks... but i still don't know how to do it.. The form part is ok, but that is only part of the problem, only the form would be "dynamic", whenever i do something else it would still refresh the whole site.

Medyman
03-25-2009, 10:41 PM
This (http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm) might be helpful.