I have a very strange issue with JQuery, its about a starting of JQuery code when document is ready, as I know there is no difference to use one of methods $(function(){//CODE});, (function($)(){//CODE}(JQuery) or $(document).ready(function(){//CODE});.
Like what said on What is the difference between $(document).ready(function() and $(function() ?
So I like always to use $(function(){//CODE}); method, but when I using this method in some pages working well, but in another I got errors like If I use $.fn.extend or $.browser.msie , I'll get '$.fn is undefined' issue, tried to use (function($)(){//CODE}(JQuery) and that error disappeared, I just want to know why this happening and really if there is and difference between each method !