之前在Chrome里运行正常的代码,Chrome升级到56后报表单提交错误:
Form submission canceled because the form is not connected
代码如下:
function submitData(name) {
var form = $('<form method="post" action="updateName">'
+'<input type="submit"/>'
+'<input type="hidden" name="name" value="'+ name +'" /></form>');
$('input[type="submit"]', form).click();
}
问题解决
原因
HTML标准规定如果form表单没有被添加到document里,那么form表单提交将会被终止。
参考:Form submission algorithm
在Chrome56之前的版本是不符合标准的,Chrome56修复了这个问题,让form表单提交符合标准要求:
参考:Chrome issue 2416033002
解决方法
解决方法就是把form表单添加到document后再提交:
jQuery
$(document).append(form);
或
document.body.appendChild(form);
分享到:
相关推荐
js-ajax-form-submission-源码.rar
Document Submission Form 2018 (green).docx
Ajax-Codeigniter-3-Ajax-Form-Submission.zip,“codeigniter 3 ajax表单提交和验证教程”一集的源代码,ajax代表异步javascript和xml。它是多种web技术的集合,包括html、css、json、xml和javascript。它用于创建...
The default is that every button in a form causes validation logic to run, and if validation fails, the validation logic blocks submission of the form. Enabling validation selectively for buttons ...
形式创造 form-create是一个表单生成组件,可以通过JSON生成动态呈现,数据收集,验证和提交功能。 支持3个UI框架,并支持生成任何Vue组件。 内置20种常用的表单组件和自定义组件,无论如何轻松地处理复杂的表单。...
3. The Licensee shall immediately inform the Licensor in written form on any use of third parties and any circulation providing the third party's statement of submission under the provisions of the ...
第四届工业大数据创新竞赛-水电站入库...初赛线上第一段2月份25.4分,第二段最高分10.0分,第三段不好意思说,可看文章末尾我的提交结果记录,第一次9月8号提交第六名,当时开心的要死,之后排名一路下降,大佬们太强了
He also send me a nice patch, so the bug is fixed.- Craig Manley added a ExtraHeaders property, please, use with care, it‘s just not valid to put inside it whatever thing.- The CC header was not ...
表格提交属性填写 简单的polyfill处理旧版浏览器中的html5表单提交属性 函数必须应用于表单,即$('form')。formSubmissionAttributes(),否则它将输出警告并取消对该元素的执行。 该脚本将从表单内部或通过form...
训练结果
js-ajax-form-submission 有关使用AJAX提交HTML表单的教程。 视频链接:<即将推出>
form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For...
form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For...
<a href="http://www.rankexperts.com">article submission</a> , <a href="http://www.rankexperts.com">article submission service</a> , <a href="http://www.rankexperts.com">build backlinks</a> , ...
泰坦尼克号数据集,官网下载(gender_submission,test,train),一共三个
Goals: This assignment is designed to reinforce the student's understanding of the use of hash tables as searchable containers. Outcomes: Students successfully completing this assignment would master...
If the age is estimated, is it in the form of xx.5 sibsp: The dataset defines family relations in this way... Sibling = brother, sister, stepbrother, stepsister Spouse = husband, wife (mistresses ...
语言:English (United ...此加载项的主要目的是使用相同的Google表单和Google单,以自动将条目添加到新标签中,每一个... 此加载项的主要目的是 使用相同的Google表单和Google Shoto每天自动将条目添加到新选项卡。
Goals: This assignment is designed to reinforce the student's understanding of the use of hash tables as searchable containers. Outcomes: Students successfully completing this assignment would master...