$.post [object Object] xhr fail
Hi guys!
I'm rly new at jquery, so sry, if it's really obvious for you. I tried debugging for like a day or so, without success.
So what I want to do is:
Instead the submit I want to do an ajax jquery ($.post) method , which sends the form's data to
http://213.181.208.168/tryhard/ URL. So the data should contain a 'token' with a value of 'asd123' (i solved it with a hidden input field if i'm right) and the other forms' values.
If the post was successful then under the form a message should appear that tells the user so. (eg.: registration).
If the post wasn't successful then it should tell the same way as the success, but obviously with another msg AND if the failure was a 433 error then the color must be red (.css("color","red");)
Here is the codepen link, hope u can help me guys :)
I thought it should work, but whatever I do, it goes to .fail and xhr is
[object Object]
Thank you for your help in advance :)