As stated many times before, the header(Location:""); works fine, do it before outputting anything to the browser, you can do all the script you want, just don't do an echo or print or send the <head> tag to the browser.
The problem with using Javascript (or any other client side script for that matter) to do a redirect is that some folks simply turn it off, and then you're stuck. If you do use it, you'll need to have a back up plan, and unfortunately you won't be able to use the header() function to do it because you've already sent a stream to the browser to write the Javascript.
HTH
Jim Hawley