I have a template part with lots of html that I use both to add statically and dynamically to a page. The problem is the trailing 0 when adding with ajax which we get rid of using die() but that cuts off all content below when the function is added statically.

  • 3
    its better to create a function that create the output. then in AJAX you call the function and end with "exit()" and in the template, you just use the function. – mmm May 30 '18 at 10:15
  • That definitely works – user300979 May 30 '18 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.