Skip to content
Advertisement

laravel ajax response return html elements

I have used made use of ajax before, but have not encounted this sort of problem,

here is my form

JavaScript

onclick of the save button, ajax is firedup, this is the ajax

JavaScript

here is my controller

JavaScript

in this controller, i have set a condition to check if request has been made so to make edit, so I simply echoed ‘Yes’ for the sake of testing and this question. Meaning my ajax response is simply suppose to be ‘Yes’ string literal, but below is what I get in the as response

JavaScript

JavaScript

Advertisement

Answer

I think it should look something like this

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement