Avatar of Kinderly Wade
Kinderly Wade
Flag for United States of America asked on

Question regarding to $.ajax() with type "POST" vs $.post()

Hi Experts

I came across this scenario which I can do a post with JQuery ajax() or post(). I am not sure which one to use. I read some information from web but I believe the information wasn't correct because the website mentioned that $.post() only has success callback but I believe it has other function from this link: https://api.jquery.com/jquery.post/ which mentioned that "The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback methods are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead."

Now I am kind of confused as to which one to use. I will provide some feedback of what I am trying to do perhaps it will be easier to find the correct method for me. I have a login page that will take inputs from users (userID and password). I am trying to post the information to another page which it will validate user's input. If information is correct then it will return something  along the line of success() callback.

Rest of my pages will follow the same post structure. I need some suggestions as to which post should I use. Thanks
jQueryJavaScript

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
SOLUTION
Leonidas Dosas

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Julian Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Kinderly Wade

ASKER
Thanks all for the feedback. I will keep them all under $ajax
Julian Hansen

You are welcome.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes