python websocket 这里的e是什么?里面的属性分别是什么?


这里的e是什么?它的属性用在哪里?


 socket = new WebSocket(host, protocols);
            socket.onopen = function(e){
                socket_connected = true;
                var i
                for(i in eval(e)){
                    xprint('<span>【socket connected】</span>:'+i+':'+e[i]);
                }
            };

属性:
【socket connected】stopPropagation:function stopPropagation() { [native code] }
【socket connected】stopImmediatePropagation:function stopImmediatePropagation() { [native code] }
【socket connected】preventDefault:function preventDefault() { [native code] }
【socket connected】initEvent:function initEvent() { [native code] }
【socket connected】getPreventDefault:function getPreventDefault() { [native code] }
【socket connected】type:open
【socket connected】target:[object WebSocket]
【socket connected】currentTarget:[object WebSocket]
【socket connected】eventPhase:2
【socket connected】bubbles:false
【socket connected】cancelable:false
【socket connected】defaultPrevented:false
【socket connected】isTrusted:true
【socket connected】timeStamp:1391069956990806
【socket connected】originalTarget:[object WebSocket]
【socket connected】explicitOriginalTarget:[object WebSocket]
【socket connected】NONE:0
【socket connected】CAPTURING_PHASE:1
【socket connected】AT_TARGET:2
【socket connected】BUBBLING_PHASE:3
【socket connected】ALT_MASK:1
【socket connected】CONTROL_MASK:2
【socket connected】SHIFT_MASK:4
【socket connected】META_MASK:8

python socket

卑鄙者的通行证 11 years, 10 months ago

e event (事件) 的首字母。

阿波罗小萨 answered 11 years, 10 months ago

Your Answer