Xuân Tùng
Xuân Tùng

Reputation: 91

How to hidden Querystring in nodejs + ajax

I'm wan't to make a basic login form. I'm using method Post in ajax fucntion, but querystring still show in here...

What can't I do (☝◞‸◟)☞ Thank for any help!

[here is login form][1]

but querystring still unhidden

my ajax code

Upvotes: 1

Views: 50

Answers (2)

Xuân Tùng
Xuân Tùng

Reputation: 91

I'm put the button submit out of the form tag and it works for me.

Upvotes: 0

Waseel Ahmad Mufti
Waseel Ahmad Mufti

Reputation: 170

Actually, what is happening is when you click on submit button your original form is also submitting directly to the backend, your form should be submit from Ajax call. So, what you can do just add following line in the starting of your Login function:

Login = (e) => {
     e.preventDefault();
    /*.. your remaining code*/
}

Upvotes: 1

Related Questions