• 中文
    • English
  • 注册
    • 查看作者
    • jQuery模拟form表单提交

      /**
       *模拟form表单提交
       * url:请求链接
       * postData:json格式的参数
       * method:请求方式 get或者post
       * isNew 是否在新窗口中打开
       */
      function formSubmit(url, postData, method = "get", isNew = false) {
          var tempform = document.createElement("form");
          tempform.action = url;
          tempform.method = method;
          if (isNew) {
              /*在新窗口中打开*/
              tempform.target = "_blank";
          }
          tempform.style.display = "none";
          for (var x in postData) {
              var opt = document.createElement("textarea");
              opt.name = x;
              opt.value = postData[x];
              tempform.appendChild(opt);
          }
          document.body.appendChild(tempform);
          tempform.submit();
      }

    • 1
    • 0
    • 0
    • 216
    • 似水流年

      请登录之后再进行评论

      登录
    • 返回顶部
    • 做任务
    • 实时动态
    • 偏好设置
    • 到底部
    • 单栏布局 侧栏位置: