The statement $(function()) in jQuery is a shorthand for $(document).ready( ...
Does it make sense having just once at the beginning of the script portion and holding all the script code (as example within tags in a aspx page) as needed?
Or rather would it be better to replicate it more than once and containing each set logic of correlated code?
As example:
<script>
$(function()
{
//script code for function 1
});
$(function()
{
//script code for function 2
});
</script>
Is there any “best practice” about it or are both approaches exaclty equivalent?
I would get functions off
$(function(){});Put there only function calling & doing other stuff.
multiple $(function(){}); calls are very expensive!
proof