I have a validator that returns a JSON to a . js that reads this JSON and displays the error messages or releases Submit. However, sometimes the browser opens JSON itself instead of showing the error messages. Someone has seen something similar?
Apparently it is the correct behavior, only you must access this route by AJAX and not by GET in the browser.
If your server responds with a JSON and the browser is opening the URL, it is natural that it displays JSON. I don’t understand what the problem is there.
Anderson, the correct thing would be for javascript to read this JSON and add the error messages to the HTML. However, this occurs sometimes, sometimes not.
Apparently it is the correct behavior, only you must access this route by AJAX and not by GET in the browser.
– fernandosavio
If your server responds with a JSON and the browser is opening the URL, it is natural that it displays JSON. I don’t understand what the problem is there.
– Woss
Anderson, the correct thing would be for javascript to read this JSON and add the error messages to the HTML. However, this occurs sometimes, sometimes not.
– Willian Scaquett