Link Button on the page and set it as default button, work fine in IE but not in Mozila

后端 未结 5 1831
梦如初夏
梦如初夏 2020-12-04 02:46

I have a link button on the page and set it as default button, It works fine in IE but not working in Mozila Firefox. Does anybody have any clue how to reso

5条回答
  •  醉话见心
    2020-12-04 03:18

    My first Stack Overflow write, wow :-)

    asp.net:

    
        First name: 
        
    
    

    js:

    $(document).ready(function () { $('.button').eventClick(); });
    
    $.fn.eventClick = function() {
        function eventClick(a) { 
                if (a && typeof (a.click) == 'undefined') {
                    a.click = function () {
                        var result = true;
                        if (a.onclick) result = a.onclick();
                        if (typeof (result) == 'undefined' || result) {
                            eval(a.getAttribute('href'));
                        }
                    }
                }
            }
            return eventClick($(this).get(0));
    }
    

提交回复
热议问题