How to redirect through 'POST' method using Javascript?

前端 未结 11 1107
说谎
说谎 2020-12-05 10:05

I\'ve queried and doesn\'t work out what I\'ve found. Is there any way to redirect to give url with POST method using Javascript or jquery?

11条回答
  •  伪装坚强ぢ
    2020-12-05 10:51

    Try this:

    var url = 'http://example.com/vote/' + Username;
    var form = $('
    ' + '' + '
    '); $('body').append(form); $(form).submit();

提交回复
热议问题