{"json_modified": "2014-03-25T18:08:58.308377", "slug": "Server-sent_events/EventSource", "tags": [], "locale": "zh-CN", "title": "EventSource", "translations": [{"locale": "en-US", "url": "/en-US/docs/Web/API/EventSource", "last_edit": "2014-02-26T11:50:18", "title": "EventSource"}], "modified": "2014-03-25T18:08:58", "label": "EventSource", "url": "/zh-CN/docs/Server-sent_events/EventSource", "last_edit": "2013-01-20T03:45:22", "summary": "EventSource\u63a5\u53e3\u7528\u6765\u7ba1\u7406\u670d\u52a1\u5668\u53d1\u9001\u4e8b\u4ef6.\u4f60\u53ef\u4ee5\u901a\u8fc7\u5c06EventSource\u5bf9\u8c61\u7684onmessage\u5c5e\u6027\u6307\u5411\u4e00\u4e2a\u81ea\u5b9a\u4e49\u65b9\u6cd5\u6765\u5904\u7406\u90a3\u4e9b\u4ece\u670d\u52a1\u5668\u63a5\u53d7\u5230\u7684\u65e0\u7c7b\u578b\u7684\u6d88\u606f(\u4e5f\u5c31\u662f,\u6ca1\u6709event\u5b57\u6bb5\u7684\u6d88\u606f).\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528addEventListener()\u65b9\u6cd5\u6765\u76d1\u542c\u5176\u4ed6\u6307\u5b9a\u4e86\u4e8b\u4ef6\u7c7b\u578b\u7684\u6d88\u606f.", "sections": [{"id": "Method_overview", "title": "\u65b9\u6cd5\u6982\u8ff0"}, {"id": "Attributes", "title": "\u5c5e\u6027"}, {"id": "Constants", "title": "\u5e38\u91cf"}, {"id": "Methods", "title": "\u65b9\u6cd5"}, {"id": "close()", "title": "close()"}, {"id": "Parameters", "title": "\u53c2\u6570"}, {"id": "init", "title": "init"}, {"id": "Parameters", "title": "\u53c2\u6570"}, {"id": ".E6.B5.8F.E8.A7.88.E5.99.A8.E5.85.BC.E5.AE.B9.E6.80.A7", "title": "\u6d4f\u89c8\u5668\u517c\u5bb9\u6027"}, {"id": "See_also", "title": "\u76f8\u5173\u94fe\u63a5"}], "id": 60009, "review_tags": []}