jQuery alerts在jQuery 1.11.2上不起作用;类型错误:n.browser未定义;

jQuery alerts is not working on jquery 1.11.2 , "TypeError: n.browser is undefined"

本文关键字:jQuery 错误 类型 未定义 browser 不起作用 alerts      更新时间:2024-06-11

我过去在jQuery 1.8.2中很好地处理jQuery警报,来自:-

/jQuery Alert Dialogs插件////1.1版////Cory S.N。拉维斯卡//美丽的网站(http://abeautifulsite.net/)

但现在我已经升级到jQuery1.11.2,并且在调用jAlert:-时开始收到这个错误

TypeError: n.browser is undefined

...er").addClass(n.alerts.dialogClass);var e=n.browser.msie&&parseInt(n.browser.ver...

现在我检查了相关的脚本,发现它使用了$browser,这在jQuery1.9:-中已经不可用了

_show: function(title, msg, value, type, callback) {
            $.alerts._hide();
            $.alerts._overlay('show');
            $("BODY").append(
              '<div id="popup_container">' +
                '<h1 id="popup_title"></h1>' +
                '<div id="popup_content">' +
                  '<div id="popup_message"></div>' +
                '</div>' +
              '</div>');
            if( $.alerts.dialogClass ) $("#popup_container").addClass($.alerts.dialogClass);
            // IE6 Fix
            var pos = ($.browser.msie && parseInt($.browser.version) <= 6 ) ? 'absolute' : 'fixed'; 
            $("#popup_container").css({
                position: pos,
                zIndex: 99999,
                padding: 0,
                margin: 0
            });

有人能评论一下吗?不确定我是否可以将我的jAlert升级到适用于jquery 1.9+的新版本?

$.brower将无法在jQuery 1.9或更高版本中工作,除非包含jQuery迁移插件。

来源:http://api.jquery.com/jquery.browser/