Ajax request returns code instead of result of the query (solved)
The path to the ajax file was wrong. I had it as:
$.ajax(&quot;templates/ajax?search=&quot; + value, {

when it should have been
$.ajax(&quot;ajax?search=&quot; + value, {