| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How to properly perform AJAX | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
How to properly perform AJAX
I am having trouble with using AJAX. I have controller class derived from AAdmin with following action:
Code:
I also have this piece so that I do not get forbidden thrown at me when I attempt to call that action: Code:
In my javascript file I have this piece to perform AJAX call: Code:
Instead of getting value of "str" in my console, I instead get raw html of the entire default template for this controller. Any tips on what I am doing wrong are very appreciated!
__________________
X-Cart Ultimate 5.2.14 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: How to properly perform AJAX
Please check how \XLite\Controller\Customer\Rest and \XLite\Controller\Customer\Autocomplete controllers return JSON data.
I think this should help.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#3
|
|||||||
|
|||||||
Re: How to properly perform AJAX
Quote:
Thank you for your reply! I completely forgot about adding headers, but adding them did not solve my issue. I still kept receiving raw html of page on which my script was being executed. I solved this by using jQuery.ajax() post method instead and it worked just fine. But I still do not understand why I could not get core.post() to work.
__________________
X-Cart Ultimate 5.2.14 |
|||||||
|
|||
X-Cart forums © 2001-2020
|