function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sudhir_MeruSudhir_Meru 

How to call Javascript Supporting files from Static Resource

Hi, 

  There are few javascript supporting files uploaded in status resources please suggest me how to call. 

How to call below link in visualforce
 <script src="../assets/js/jquery-ui.custom.min.js"></script>

I am calling css files as mentioned below. 
<apex:stylesheet value="{!URLFOR($Resource.assets, 'assets/css/bootstrap.min.css')}" />

Thanks

Sudhir

Best Answer chosen by Sudhir_Meru
Vikash TiwaryVikash Tiwary
Hi Sudhir,

To include javascript files in page you can use as below

<apex:includeScript value="{!URLFOR($Resource.assets, 'assets/js/jquery-ui.custom.min.js')}"/>

Please let me know if it helps!

Thanks

All Answers

Vikash TiwaryVikash Tiwary
Hi Sudhir,

To include javascript files in page you can use as below

<apex:includeScript value="{!URLFOR($Resource.assets, 'assets/js/jquery-ui.custom.min.js')}"/>

Please let me know if it helps!

Thanks
This was selected as the best answer
Sudhir_MeruSudhir_Meru
Hi Vikas, 

  Can I make a call as mentioned below 

<script src="{!URLFOR($Resource.website, 'website/assets/js/jquery-ui.custom.min.js')}"></script> 

Please let me know

Thanks
Sudhir
Vikash TiwaryVikash Tiwary
Yes, even this is fine.
Thanks 
AshwaniAshwani
Both of these works:

1) <apex:includeScript value="{!URLFOR($Resource.js, 'MyJavascript.js')}"/>
2) <script src="{!URLFOR($Resource.js, 'MyJavascript.js')}"></script>

But do not use them together on visualforce page. Either use approach 1 or approach 2. Javascript interpretes top to bottom.