首页 > Web开发 > 详细

js 模拟 post

时间:2014-03-27 15:36:05      阅读:443      评论:0      收藏:0      [点我收藏+]

js 模拟 post 提交

bubuko.com,布布扣
        //js 模拟创建一张表
                var target = ‘_blank‘;
                var tempForm = document.createElement("form");
                tempForm.id = "tempForm1";
                tempForm.method = "post";
                tempForm.action = ‘<?php echo $HTTP_URL;?>capture‘;
                tempForm.target = target;
        
        //添加表元素
var authkeyInput = document.createElement("input"); authkeyInput.type = "hidden"; authkeyInput.name = ‘authkey‘; authkeyInput.value = ‘XX‘; tempForm.appendChild(authkeyInput); var libInput = document.createElement("input"); libInput.type = "hidden"; libInput.name = ‘lib‘; libInput.value = ‘serverControl‘; tempForm.appendChild(libInput);

        //添加表
        document.body.appendChild(tempForm);
                
                tempForm.submit();
                document.body.removeChild(tempForm);
bubuko.com,布布扣

 

 

 其他:http://www.360doc.com/content/12/0731/14/9629506_227464533.shtml

js 模拟 post,布布扣,bubuko.com

js 模拟 post

原文:http://www.cnblogs.com/la-isla-bonita/p/3627893.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!