1
可能重複:
How to trigger event in JavaScript
JavaScript custom Event Listener的Javascript自定義事件
我創建新的自定義事件是這樣的:
window.addEventListener('customEvent', function() { doSomethingOnEvent(); }, false);
我怎樣才能觸發這種自定義事件?
http://stackoverflow.com/questions/9671995/javascript-custom-event-listener – elboletaire