Jquery ie responseText不完整
我在FF、Safari中有一个可用的上传进度条,但在IE中没有 表单是基于jquery.form提交的,但当上传完成后,PHP应用程序将发送一个全新的页面,该页面将在xhr.responseText中接收。将响应放置在新文档中 这适用于FFJquery ie responseText不完整,jquery,internet-explorer,internet-explorer-9,Jquery,Internet Explorer,Internet Explorer 9,我在FF、Safari中有一个可用的上传进度条,但在IE中没有 表单是基于jquery.form提交的,但当上传完成后,PHP应用程序将发送一个全新的页面,该页面将在xhr.responseText中接收。将响应放置在新文档中 这适用于FF 在IE上,响应文本以“\n这是白鹅追逐的一部分 使用setTimeout(updateinfo,2)启动脚本确实有效;然后继续提交表单。我们可以看到一些代码吗?您如何获得responseText?如果您使用jQuery,我相信它使用片段来保存元素,而片段不能
在IE上,响应文本以“\n这是白鹅追逐的一部分
使用setTimeout(updateinfo,2)启动脚本确实有效;然后继续提交表单。我们可以看到一些代码吗?您如何获得responseText?如果您使用jQuery,我相信它使用片段来保存元素,而片段不能保存html/head/body标记,因此它们通常会被过滤掉。不确定为什么它会在Firefox中工作?您正在设置什么内容类型??(默认:“application/x-www-form-urlencoded;charset=UTF-8”)是的,好的,我已经更新了问题以包含代码。我要求html并使用jquery返回到成功函数的responseText。好的,通过jquery表单进行跟踪,它决定使用iframe路径(它没有决定使用FF)。
$('#JQF').ajaxForm({
dataType: 'html',
beforeSend: UP.start,
success: UP.stop
});
UP.stop:
function (html, status, xhr) {
startTime = null;
setTimeout(function () {
jsonForm.success(html, status, xhr);
}, 10);
}
jsonForm.success:
function(responseText, statusText, xhr, elt)
/*
1.) responseText or responseXML value (depending on the value of the dataType option).
2.) statusText
3.) xhr (or the jQuery-wrapped form element if using jQuery < 1.4)
4.) jQuery-wrapped form element (or undefined if using jQuery < 1.4)
)
*/ {
if (typeof responseText === 'string')
{
if (/<html>/i.test(responseText))
{
jsonForm.reloadMain(responseText);
}
else if (responseText)
{
alert(responseText); <<<========== this is executed.
}
}
else if (responseText && typeof responseText === 'object')
{// decode and execute jquery instructions
jsonForm.responseEval(responseText, {});
jsonForm.init(); // in case we loaded something with a jsonForm in it
}
}