Search code examples
javaajaxenfinityintershop

Serving AJAX request from Pipeline in Enfinity


I know a little bit about how to create AJAX request using Javascript. But I want to understand how to handle AJAX request using pipeline in Enfinity. Is there any special treatment? Can I just receive the connection using the standard pipeline and standard pipeline url encoding using url() or urlex() function? How if I want to return a value? Do I need special treatment? Or I just can return it as usual page using template?


Solution

  • From server point of view there is no difference between an "ordinary" and an AJAX request. There is no special treatment. Calling a view pipeline and rendering an ISML template in the interaction node is perfectly fine. If you return a JSON as the AJAX response you should mark this in the template, e.g.:

    <iscontent type="text/json" charset="UTF-8" compact="true" templatemarker="false">