ryelqy

javascript动态创建Form表单和表单项,然后提交表单请求,最后删除表单,代码片段如下(Firefox测试通过):

 

 

var dlform = document.createElement(\'form\');
dlform.style = "display:none;";
dlform.method = \'post\';
dlform.action = \'../fileServlet\';
dlform.target = \'callBackTarget\';
var hdnFilePath = document.createElement(\'input\');
hdnFilePath.type = \'hidden\';
hdnFilePath.name = \'filePath\';
hdnFilePath.value = filePath;
dlform.appendChild(hdnFilePath);
document.body.appendChild(dlform);
dlform.submit();
document.body.removeChild(dlform);


原文出处:

[1] MySomeDay, js动态创建Form表单并提交, https://www.cnblogs.com/haoqipeng/p/5171431.html

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-08-21
  • 2022-03-09
  • 2022-12-23
  • 2021-10-19
  • 2021-10-19
  • 2021-10-19
猜你喜欢
  • 2021-07-30
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
相关资源
相似解决方案