Ajax with concrete5 classes and objects, how to?
Permalink
I need to make a (jquery) ajax call to a php page, but I am not sure
a) where to put my php page
b) what to include in my php page
so that I can access the concrete5 framework, for example, the $c object, or using the PageList object, or accessing any classes in any of my packages. Is it possible to do this?
I have something like:
I want to use ajax to send an id to my php page, use the php page to get a page object by the id, and then to return a class name (custom attribute) that I can apply some animation on...
a) where to put my php page
b) what to include in my php page
so that I can access the concrete5 framework, for example, the $c object, or using the PageList object, or accessing any classes in any of my packages. Is it possible to do this?
I have something like:
$.ajax ({ url: 'http://www.inspiritfoundation.ca/dev/themes/inspirit/get_map_page.php', type: 'POST', data: { id: id }, success: function(data) { var class = '.' + data; $(class).animate({ opacity: .25; }) } });
I want to use ajax to send an id to my php page, use the php page to get a page object by the id, and then to return a class name (custom attribute) that I can apply some animation on...
http://www.concrete5.org/marketplace/addons/ajax-lessons/...
Hope it helps.