armydude08
New Member
Let's say I have the following script\[code\]<script type="text/javascript"> $(function($, d) { var custom: { settings: { news: $('div.news') }, init: function() { this.settings.news.html('new'); } } }(jQuery, $(document)))</script>\[/code\]You can assume that the object has more functionality, but my question is where should I place it?I know two approaches:[*]Place the script in the \[code\]<header>\[/code\] tag. That way I will have to make sure the object is called only after document.ready, so the settings jQuery objects (\[code\]$('div.news')\[/code\]) won't be empty.[*]The second way is less semantically correct in my opinion, but I can give up the document.ready function: I can just "physically" place the script after the html.What solution would you prefer and why? Thanks from advance!