It is always recommended to avoid inline Javascript codes by putting all codes in a JS
file, which is included in all pages. I wonder, if this does not cause pe
there are variuos case that needs to be keep in mind while placing js code.
For inline :
there is no need to navigate to an external file if you need to change something quickly, so its better in locality
if you are using AJAX in some elements of your page you may loose all the dom element onclick etc for that section, that obviously depends on how you binded them. for ex you can use live or delegate in case your using jQuery to avoid above said problem... but i find that if js is small enough it is preferable to just put it inline.
Now there other theory for ex
Externalizing javascript is one of the yahoo performance rules:
http://developer.yahoo.com/performance/rules.html#external