Modify POST vars before post, using jQuery

前端 未结 8 714
醉话见心
醉话见心 2020-12-29 18:34

I have a form, and a submit handler in jQuery.

When the user submits the form, I want to modify (add) some parameters to the POST request, before it is despatched fr

8条回答
  •  -上瘾入骨i
    2020-12-29 18:53

    I have been working on this question for one day, and I come up with a good solution:

    you could use Jquery .clone() to create a copy of the form you want to submit. Then you could do the modifications on the copy, and finally submit the copy.

提交回复
热议问题