我有一个jQuery代码来显示弹出窗口(“显示请等待消息”)。此代码在Firefox中运行良好,但在Chrome或IE浏览器中无效。请检查我的代码并告诉我它为什么不起作用。 脚本代码。
X = text1/text2/text3
Y = X.text.Remove(0, 12)
Result = text3
这是我的HTML代码
function ShowStickerWindow() {
if (_ajaxRequests.length < 1) {
var width;
var height;
//calculating body width. handle IE 6
if ($.browser.msie && $.browser.version < 7) {
var scrollWidth = Math.max(document.documentElement.scrollWidth, document.body.scrollWidth);
var offsetWidth = Math.max(document.documentElement.offsetWidth, document.body.offsetWidth);
if (scrollWidth < offsetWidth) {
width = $(window).width() + 'px';
} else {
width = scrollWidth + 'px';
}
// handle "good" browsers
} else {
width = $(document).width() + 'px';
}
//calculating body width. handle IE 6
// handle IE 6
if ($.browser.msie && $.browser.version < 7) {
var scrollHeight = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight);
var offsetHeight = Math.max(document.documentElement.offsetHeight, document.body.offsetHeight);
if (scrollHeight < offsetHeight) {
height = $(window).height() + 'px';
} else {
height = scrollHeight + 'px';
}
// handle "good" browsers
} else {
height = $(document).height() + 'px';
}
$('#' + _screenDiv).addClass('screen').css({
'width': width,
'height': height,
'zIndex': 10000
});
$('#' + _screenDiv).show();
var wnd = $(window),
doc = $(document),
pTop = doc.scrollTop(),
pLeft = doc.scrollLeft();
pLeft += (wnd.width() - 200) / 2;
pTop += (wnd.height() - 200) / 2;
//_processingDiv is the id of Popup
$('#' + _processingDiv).css({
'left': pLeft + 'px',
'top': pTop + 'px',
'zIndex': 10001
}).show();
if ($.browser.msie && $.browser.version < 7) {
$('select').each(function () {
$(this).hide();
});
}
}
ShowStickerWindow();