form表單 post 請求打開新頁面


function postOpenWindow(URL, PARAMS, target) {
                    if(target == null) target = "_blank";
                    var temp_form = document.createElement("form");
                    temp_form.action = URL;
                    temp_form.target = target;
                    temp_form.method = "post";
                    temp_form.style.display = "none";
                    for(var x in PARAMS) {
                        var opt = document.createElement("textarea");
                        opt.name = x;
                        opt.value = PARAMS[x];
                        temp_form.appendChild(opt);
                    }
                    document.body.appendChild(temp_form);
                    temp_form.submit();
                    document.body.removeChild(temp_form);
                }
                postOpenWindow("http://localhost:8080/111.html", {}, "_blank");

 

備注 :直接訪問匯報405  錯誤

需要nginx配置

 location / {
            root   E:/test;
            index  111.html 111.htm;
            error_page 405 =200 /111.html;
            try_files $uri $uri/ /111.html;
 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM