-
MODX Staff
- 10,725 Posts
I’m not sure exactly what you are doing, but in order to use the $modx object on a request/response of any kind, you have to build the object first. AJAX uses server requests and responses after the page has been generated on the client, so in order for your php file to have access to the MODx object, the script would probably have to create a new instance of it for use during that AJAX request/response cycle.
It can probably be done, but may not be the best approach from an AJAX performance perspective.
I think this is the issue at least; just guessing really...
Hi, I don’t know if you remeber your post aout using modx object in a php external file for use with ajax but I try to do the same thing and I don’t know how, can you give more details on how you resolved this issue?
please read this document, this clarifies a way to work in MODx using ajax
http://wiki.modxcms.com/index.php/Use_AJAX_with_modxAPI
visit us at www.dospuntocero.cl