Hi there
I am developing a plugin which uses a lot of ajax calls from the ui. When the user clicks something within my plugin calls are made to onXXX() functions in my component.
I am often wanting to return pure HTML/text back from these ajax requests and render the content in divs. However any content i return from the onXXXX() AJAX call back to the client is wrapped in json as { "result": "HTML content" };
I can modify my ajax requests to decode the json, but i was wondering if there was a way in october to indicate that data returned from a plugin is just raw text which can be passed back to the client.
I could also just echo the content within the Ajax function and then die, but i dont think thats probably the best way.
Also i think i should say that i am making the calls to the component manually from my own js included using AddJs. I make these calls directly by setting :- X-OCTOBER-REQUEST-HANDLER': 'ReporticoAdmin::onAjax in the header in order to get it routed through october. im not using any partials
Thanks for any advice on this received.
Peter Reportico
Last updated