I have stored JavaScript file into the Static Resources at Salesforce. But i can't call those javascript file from Visualfroce. Please give me any solution how can i call those javascript file from visualforce.
Thanks
In your JavaScript file, define an object and its function as such:
// file: MyScript.js
var myScript = new {};
myScript.DoSomething = function()
{ alert("hi"); };
In your Visualforce page, include a reference to the file using the following, where "[javascript file]" is the name of the static resource:
<apex:includeScript value="{!$Resource.[javascript file]}" />
Note: the "[javascript file]" must be the name that you have given for the static resource, not the name of the file you uploaded. So, if you upload MyScript.js and name it "Scripts" in Visualforce, then your code would look like the following:
<apex:includeScript value="{!$Resource.Scripts}" />
Now you can call the JavaScript function - something like:
<a href="#" onclick="myScript.DoSomething();">link</a>