How to replace window.open(…) with a POST

后端 未结 2 1863
渐次进展
渐次进展 2020-12-02 07:05

I currently have some code that runs a window.open(urlWithGetParams) line. As far as I\'m aware, this is going to force me to use a GET request. I

2条回答
  •  不思量自难忘°
    2020-12-02 07:53

    What I do is that I do a javascript AJAX post and then I take the content that I get back and place it into a new window.

    Something like this (using jQuery, but you can use any AJAX implementation):

    $.post(URL, DATA, function(d){
        var new_window = window.open();
        $(new_window.document.body).append(d);
    });
    

提交回复
热议问题