You're triggering the event before you bind it. Move x.test() below your bind statement, and everything should be fine.
Another concern is that, according to the jQuery docs, the jQuery function is meant to take a DOM element, not a generic object. And though it seems to work for now, it might break in a later version of jQuery since it isn't a documented behavior.
What would be the alternative for trigger/bind for Objects ?
In jQuery, there doesn't seem to be any, at least none that are officially supported. You'll have to look to other libraries for documented and supported custom events.
Bookmarks