If you are developing a web part as a sandboxed solution, you could add a <JSLink>
node to your ListFormWebPart or XsltListViewWebPart definitions:
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
<TypeName>Microsoft.SharePoint.WebPartPages.ListFormWebPart</TypeName>
<PageType>PAGE_NEWFORM</PageType>
<JSLink>{path to JS file}</JSLink>
</WebPart>