This is not really an advanced topic, but it helps the guys who recently jumped in Web development Bus!
However if your script blocks wrapped inside function/uses functions that are called later in the page life cycle (e.g. event handling functions that are triggered in response to a client-side event) cool guys! You don’t need to worry. In this situation, the browser will process the entire page before your functions are triggered. As a result, you can place your script block anywhere in the HTML document! It’s your area, your rule! But, according to me <head > section is the popular choice.
I know developers are like Heroes, But please stop behaving like James Bond!!
Oops! What about older version of IE?
With versions of IE 8, you need to explicitly enable script debugging. To do so follow these steps
- Choose Tools > Internet Options from the menu in IE
- In the Internet Options dialog box, choose the advanced tab
- In the list of settings, under the Browsing group, remove the check mark next to Disable Script Debugging (IE). You can also remove the check mark next to Disable Script Debugging (Other) to allow debugging for IE windows hosted in other applications
- Click Ok to apply your changes
When script debugging is switched on, you’ll be prompted to debug web pages with script errors, even on websites that you don’t control, even on Google too! (But I’m dam sure; they don’t have any script errors)