http://jsfiddle.net/xEpGg/740/
If I call it directly right after my script using:
$.custom.test();
It works as expected. However, if I put it anywhere in the HTML, it won’t fire. I defined my object in jQuery, shouldn’t that be accessible everywhere within the page?
In case you cannot define the function in the way @frenchie suggested try:
Why is setTimeout(fn, 0) sometimes useful?
And why the heck would you want to assign anything to the jQuery global?