I'm currently trying to use AJAX (with jQuery) in my Drupal 8 module to reload a page when a user types something into a text box. I managed to get the full HTML page, but I would like the AJAX function to receive only the contents of the page (without the whole layout).
How can i achieve this? What should I change in my controller function to display a different view when the request uses AJAX?
I searched on Google and on Drupal 8 documentation, but I did not find the answer to my question.
Thanks in advance for your help!
source
share