Send post-variable with javascript?

前端 未结 5 1139
逝去的感伤
逝去的感伤 2021-01-05 19:55

Is it possible to send post-variables with javascript? I want id to be sent with post, not get.

window.location.href=\"hanteraTaBortAnvandare.ph         


        
5条回答
  •  一个人的身影
    2021-01-05 20:18

    You can submit form data via JavaScript but not using window.location.href. Changing the URL location is always going to issue a GET.

    You'll need to get a reference to your form from the DOM and then issue a submit() call to it.

提交回复
热议问题