Example using ajax

Could you please give me an example how to use ajax in grav ?

I’m able to send a GET request with jquery to a page, but i don’t know where to put the logic for its processing, and i need write the code in php or twig ?

Thanks !

I assume you’d like the URL you call to “do something” or to return some json values. You need to write a plugin that listens on a URL and returns some results.

https://github.com/flaviocopes/grav-plugin-api is a example (draft) of a plugin that provides an API. You can see how that is built, and create your own plugin.