You need to sign in to do that
Don't have an account?

How to upload .js file
How can I upload my own .js file on salesforce.com and how to use it in Custom s-control.
I want to upload that .js file for displaying data in the grid from database.
Code:
Since this thread is still one of the top responses in a search for including a .js file in an S-Control, I thought I would contribute my thoughts on the best practice for doing so.
Building on Ron's suggestion, create a new S-Control of type "Snippet" and paste your javascript code in the snippet. Be sure to wrap your JS code in the script tags as below:
<script type="text/javascript">
// My Javascript Code
</script>
After that, you can easily include your new S-Control by name using an "INCLUDE". For example, if I named my new Snippet S-Control "FooJS", I would do the include in my S-Controls using the included JS as follows:
{! INCLUDE($SControl.FooJS)}
I believe this is superior to the approaches using a document ID or sControlID because it will work in both Sandbox and production orgs without updating the IDs.
Cheers,
-Philip
Hi, I'm trying to get somthing like this to work
http://community.salesforce.com/t5/General-Development/using-JS-from-static-resource-from-onclick-javascript-on-custom/m-p/180187/highlight/false#M41036
and already try this solution but it doesn't work at all,
any ideas ?