zoukankan      html  css  js  c++  java
  • jquery , find the event handler,找到jquery中的event handler

    找到

    dispatch: function (e) {
                e = b.event.fix(e);
                var n, r, i, s, o, u = [],
                    a = d.call(arguments),
                    f = (b._data(this, "events") || {})[e.type] || [],
                    l = b.event.special[e.type] || {};
                a[0] = e, e.delegateTarget = this;
                if (l.preDispatch && l.preDispatch.call(this, e) === !1) return;
                u = b.event.handlers.call(this, e, f), n = 0;
                while ((s = u[n++]) && !e.isPropagationStopped()) {
                    e.currentTarget = s.elem, o = 0;
                    while ((i = s.handlers[o++]) && !e.isImmediatePropagationStopped())
                        //if (!e.namespace_re || e.namespace_re.test(i.namespace)) e.handleObj = i, e.data = i.data, r = ((b.event.special[i.origType] || {}).handle || i.handler).apply(s.elem, a), r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation());
                        if (!e.namespace_re || e.namespace_re.test(i.namespace))
                        {
                            console.log('enent.dispathc;beginning of invoking event handler');
                            e.handleObj = i;
                            e.data = i.data;
                            var _tmp=((b.event.special[i.origType] || {}).handle || i.handler);
                  //begin , add following code Fragment
    if(jQuery('strong',s.elem).text()=='dd') { console.log('event fired'); //add your breakpoint here, while the breakpoint is fired, input _temp in console and press enter, now you can see your handler function, click the link on the right bottom cornor to jump into the function }
                  //end r
    = _tmp.apply(s.elem, a); r !== t && (e.result = r) === !1 && (e.preventDefault(), e.stopPropagation()); } } return l.postDispatch && l.postDispatch.call(this, e), e.result; }
  • 相关阅读:
    Best Time to Buy and Sell Stock
    Remove Nth Node From End of List
    Unique Paths
    Swap Nodes in Pairs
    Convert Sorted Array to Binary Search Tree
    Populating Next Right Pointers in Each Node
    Maximum Subarray
    Climbing Stairs
    Unique Binary Search Trees
    Remove Duplicates from Sorted Array
  • 原文地址:https://www.cnblogs.com/zyip/p/3654088.html
Copyright © 2011-2022 走看看