Browser opening JSON

Asked

Viewed 45 times

0

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?

inserir a descrição da imagem aqui

  • 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.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.