Sage CRM has a Client Side method crm.ready() which is used to execute scripts once the page is loaded.
We do not have to worry whether the browser is Chrome or Internet Explorer. The crm.ready() method will take the browser version into account and add the function we pass to it in the correct way.
//function script goes here
The crm.ready() will execute the scripts as soon as the page's DOM hierarchy has been fully constructed. The function passed to crm.ready() is guaranteed to be executed after the DOM is ready. It is actually tied to loading of the document object, so this is the ideal location to run other crm clientside code.
The following example script can be added to the custom content box of the CompanyBoxLong screen and will highlight in red the comp_status field when the value of the field is 'Closed'.
if (crm("comp_status").value()== "Closed")