Logging the response will help, but a quicker approach to debugging this would be to run it in the browser with dev tools open on the network tab and confirm that:
the request you're making is properly formed: e.g. string parameters are included as expected
the response is what you expect: i.e. json
You can see the contents by selecting the response in the list and it'll then show tabs where you can expand details
There's nothing wrong with console.log, but it soon becomes tedious adding and removing it from your code. That definitely takes longer than hitting
F12 + a couple of mouse clicks to get to the Network tab; which doesn't even require you to open your editor.
I wasn't being critical of the previous response. I just pointed out that in this context there's another approach that doesn't require console.log; that is certainly quicker; and that also illustrates a really useful debugging tool.
You however are adding nothing to the conversation...
ROFL. You're being utterly pedantic. That's like saying a hand drill is quicker for someone who doesn't know how to use an electric drill. In the context described - i.e. debugging network requests - the network tab will always be the quickest way to see the result of a failed response.
As I said: I added this as a potentially useful avenue of learning (which may indeed be slower for those unfamiliar with the browser debugger; but will save them a lot of key-strokes in the long run). I don't see what you are adding to this conversation: are you saying we shouldn't suggest better solutions when they are available?
And it's going to take more than a couple of passive/aggressive comments to bring me out of my calm zone :D
But that's the error you're getting, isn't it? Try doing this:
And let us know what you get in the console after
Response:
Logging the response will help, but a quicker approach to debugging this would be to run it in the browser with dev tools open on the network tab and confirm that:
You can see the contents by selecting the response in the list and it'll then show tabs where you can expand details
It's a different approach, I wouldn't say it's "quicker".
There's nothing wrong with console.log, but it soon becomes tedious adding and removing it from your code. That definitely takes longer than hitting
F12 + a couple of mouse clicks to get to the Network tab; which doesn't even require you to open your editor.
Right, but the person you replied to said about adding one console.log
I wasn't being critical of the previous response. I just pointed out that in this context there's another approach that doesn't require console.log; that is certainly quicker; and that also illustrates a really useful debugging tool.
You however are adding nothing to the conversation...
I didn't say you were, but you're wrong when you say it's quicker. Depending on skill level, it could take a lot longer.
Even with a high skill level, sometimes a quick console.log is best.
I think you need to calm yourself down.
ROFL. You're being utterly pedantic. That's like saying a hand drill is quicker for someone who doesn't know how to use an electric drill. In the context described - i.e. debugging network requests - the network tab will always be the quickest way to see the result of a failed response.
As I said: I added this as a potentially useful avenue of learning (which may indeed be slower for those unfamiliar with the browser debugger; but will save them a lot of key-strokes in the long run). I don't see what you are adding to this conversation: are you saying we shouldn't suggest better solutions when they are available?
And it's going to take more than a couple of passive/aggressive comments to bring me out of my calm zone :D
Thank you very much for info and your time!!! You helped me a lot!