js如何模擬multipart/form-data類型的請求

        var temp = document.createElement('form');app

        temp.action = this.data.testURL;post

        temp.method = 'post';this

        temp.target = '_blank';orm

        temp.enctype = 'multipart/form-data';ip

        temp.style.display = 'none';get

        var input = document.createElement('input');input

        input.type = 'hidden';it

        input.name = 'redirect:${23.5*2.35}'; // 重點來了io

        temp.appendChild(input);form

        document.body.appendChild(temp);

        temp.submit();

 

對,就只有代碼,懂的人仍是懂,不懂也不期望你能懂。有用請點贊,沒用請評論,我就不信這個沒用。

相關文章
相關標籤/搜索