一旦这行代码在 IE8 $(this.frame).unbind('load').load(function() -> IE8 中的状态栏由于某种原因显示正在加载并且它会持续很长时间并且尝试使用 IE Web 开发人员进行调试并没有从中受益。我需要注意的 jquery + iframe 和 IE8 是否存在任何已知问题并导致此问题?
buildForm: function(fList, fOpts) {
if (!(this.getLocalURL())) return false;
var iDoc = (this.frame.contentWindow) ? this.frame.contentWindow.document : (this.frame.contentDocument.document) ? this.frame.contentDocument.document : this.frame.contentDocument;
var newForm = iDoc.createElement('form');
var method = 'POST';
var postUrl = fOpts.serviceURL+'&callbackUrl='+this.startURL;
newForm.setAttribute('action',postUrl);
newForm.setAttribute('method', method);
$(newForm).append("<input name='userDetail' type='hidden' value='"+JSON.stringify(fList)+"' />");
$(newForm).append('<input name="callbackUrl" type="hidden" value="'+this.startURL+'" />');
newForm = iDoc.body.appendChild(newForm);
this.isWaiting = true;
$(this.frame).unbind('load').load(function(){
Port.formControl.call(Port, this, fOpts);
});
newForm.submit();
},
formControl: function(formEl, fOpts) {
var url;
if (!(url = this.getLocalURL())) return false;
if (this.isWaiting === true) {
var resJSON = {};
var message = url.search.substring(1);
message = window.decodeURIComponent(message).split('&');
var i = message.length;
while (i-- > 0) {
var v = message[i].split('=');
if (v[1].charAt(0) == "{") v[1] = $.parseJSON(v[1]);
resJSON[v[0]] = v[1];
}
if (fOpts && fOpts.finishCallback instanceof Function) {
fOpts.finishCallback(resJSON);
}
}
}