document.getElementById('myid').innerHTML = 'something';
Where alert was being used for debugging you can now use the console.log command that all modern browsers support. This writes the message to the browser's console instead of displaying in front of the web page. This means that there is not such an issue if you accidentally forget to remove one of these debugging calls when your page goes live as unless your visitor has their browser console open they will not see the message.
Similarly confirm() and prompt() should not be used. The situations where they were required for debugging can now be handled by setting break points in the debugger built into all modern browsers.
num = parseInt(str);
The parseInt command is for converting between number bases. Correct use of the command would have a value between 2 and 9 or 11 and 36 as the second parameter. Where the second parameter is 10 or missing then this is the wrong command to use.
num = Number(str);
Where the intention is to convert a string to a number then the correct command for doing the conversion is Number.
dim = /^(\d+)(\D*)$/.exec(cssprop);
One alternate misuse of parseInt is for extracting the numeric portion of a CSS attribute. A better alternative for that purpose is to use this regular expression which extracts both parts of the attribute into dim and dim respectively. You can then convert the dim part to a number if required while still having access to the following characters. So for example if cssprop contained '30em' then dim would be '30' and dim would be 'em'.
The only exceptions where the script must go in the head that I know of are the following two one line scripts (and any more complex variants of these two scripts).
if (top.location !== self.location) top.location = self.location;
document.getElementsByTagName('html').className += ' js';
The only instance in an HTML page where onload is still required when the script is at the bottom of the page is where you want processing to run if files the page uses fail to load.
This article written by Stephen Chapman, Felgall Pty Ltd.