Link to home
Start Free TrialLog in
Avatar of Kinderly Wade
Kinderly WadeFlag 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
SOLUTION
Avatar of Leonidas Dosas
Leonidas Dosas
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kinderly Wade

ASKER

Thanks all for the feedback. I will keep them all under $ajax
You are welcome.