Reputation: 64266
I started writing with magento. I have to do some ajax request for my own php-script located somewhere in local pull. The questions are: Where to store such php-scripts and with what address access them from ajax-request?
Upvotes: 1
Views: 1430
Reputation: 10964
Just create a Controller that has an action that will handle the AJAX call. So if your module has a route of http://www.yoursite.com/yourscript, and you already have your IndexController, just put another action in there such as ajaxAction(). This action will simple print out the data you want to be consumed, and not render the rest of the page. Then you can point your AJAX call to http://www.yoursite.com/yourscript/index/ajax.
Upvotes: 2