thecodeholic/php-mvc-framework

AJAX Call

christiandimayacyac opened this issue · 0 comments

How do you do Ajax call on top of MVC? From what I can remember the last time I used Ajax on top of DIY MVC framework I always get html contents instead of JSON data. Note that I tried the json_encode from the server side and JSON.parse on the front end but I'm getting an error. I could get data only if the data needed is embedded on the views file then extract it using selectors on the front end. I'm looking for a solution where the MVC can return JSON data directly after AJAX call.