Check if user is using IE

后端 未结 30 1600
心在旅途
心在旅途 2020-11-22 04:34

I am calling a function like the one below by click on divs with a certain class.

Is there a way I can check when starting the function if a user is using Internet

30条回答
  •  灰色年华
    2020-11-22 04:59

    I think it will help you Here

    function checkIsIE() {
        var isIE = false;
        if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {
            isIE = true;
        }
        if (isIE)  // If Internet Explorer, return version number
        {
            kendo.ui.Window.fn._keydown = function (originalFn) {
                var KEY_ESC = 27;
                return function (e) {
                    if (e.which !== KEY_ESC) {
                        originalFn.call(this, e);
                    }
                };
            }(kendo.ui.Window.fn._keydown);
    
            var windowBrowser = $("#windowBrowser").kendoWindow({
                modal: true,
                id: 'dialogBrowser',
                visible: false,
                width: "40%",
                title: "Thông báo",
                scrollable: false,
                resizable: false,
                deactivate: false,
                position: {
                    top: 100,
                    left: '30%'
                }
            }).data('kendoWindow');
            var html = '

    Please use the browser below to use the tool

    '; html += ''; html += ' '; html += ' '; html += '
    '; windowBrowser.content(html); windowBrowser.open(); $("#windowBrowser").parent().find(".k-window-titlebar").remove(); } else // If another browser, return 0 { return false; } }

提交回复
热议问题