All of we know how it is tedious to write js code in MS CRM.
We can include the js files in each entities as it used to be done in html,jsp,aspx etc files.
//create a script element
var script = document.createElement("script");
//set the language to janscript [optional]
//set the source of the js file with relative or absolute path
script.src = "http://PositiveEdge/js/Sample.js";
//finally add the script element to the head