<script type="text/javascript">
var ep = new YAHOO.util.EventProvider()
ep.createEvent('CustomEventUserLoggedIn')
function fe() {
ep.fireEvent('CustomEventUserLoggedIn', { login: '[email protected]', name: 'hello world' })
}
ep.subscribe('CustomEventUserLoggedIn', function (oArgs) {
alert('custom event detected\r\nDATA:\r\nlogin: ' + oArgs.login + '\r\nName: ' + oArgs.name)
})
</script>
<h2>Custom events</h2>
<a href="javascript:void(0)" onclick="fe()">fire custom event «CustomEventUserLoggedIn»</a>