Non-DOM Events in jQuery
>>> function User(){}
>>> var u = new User
>>> u
Object
>>> $(u)
[Object]
>>> $(u).bind('login', function(){console.log('login')})
[Object jQuery1250738637761=27]
>>> var j = $(u).bind('login', function(){console.log('login')})
>>> j
[Object jQuery1250738637761=27]
>>> $(u).trigger('login')
login
login
[Object jQuery1250738637761=27]
No comments :
Post a Comment