You need to sign in to do that
Don't have an account?
Ashok S 7
how can use static resource in visualforce page
Hai,
I am using static resource in my visual force page. But in that visual force i used alert message and toggle function. but it is not working properly.I tried but it is not comming.
Vf page
--------------------------
<apex:page >
<apex:includeScript value="{!URLFOR($Resource.jqueryui,'/Naveen/jquery/jquery.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.jqueryui,'/Naveen/jquery/jquery-ui.js')}"/>
<script>
j$=jQuery.noConflict();
if(j$){
alert('Success');
}
else
{
alert('Failure');
}
function show()
{
j$('[id$=one]').toggle()
}
</script>
<apex:pageBlock id="pb" title="FirstBlock" onmouseover="show()">
This is Block one
</apex:pageBlock>
<apex:pageBlock id="one" title="FirstBlock">
This is Block one
</apex:pageBlock>
</apex:page>
Any one help me to slove this.Please.
I am using static resource in my visual force page. But in that visual force i used alert message and toggle function. but it is not working properly.I tried but it is not comming.
Vf page
--------------------------
<apex:page >
<apex:includeScript value="{!URLFOR($Resource.jqueryui,'/Naveen/jquery/jquery.js')}"/>
<apex:includeScript value="{!URLFOR($Resource.jqueryui,'/Naveen/jquery/jquery-ui.js')}"/>
<script>
j$=jQuery.noConflict();
if(j$){
alert('Success');
}
else
{
alert('Failure');
}
function show()
{
j$('[id$=one]').toggle()
}
</script>
<apex:pageBlock id="pb" title="FirstBlock" onmouseover="show()">
This is Block one
</apex:pageBlock>
<apex:pageBlock id="one" title="FirstBlock">
This is Block one
</apex:pageBlock>
</apex:page>
Any one help me to slove this.Please.
Can you check the path of resource file. make sure it is loading correctly using inspect element sources.
I am assuming you have uploaded zip file as static resource and the zip folder name is 'Naveen'. So you try the below line.
<apex:includeScript value="{!URLFOR($Resource.Naveen,'Naveen/jquery/jquery.js')}"/>
Regards,
Pawan Kumar
PS: Please let me know if it helps you.
Try the below code it works fine with your requirement. You should check your static resource files.
I hope you find the solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi