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
MRDJMRDJ 

Static Resources in vf page for datatable is not working

Hello,

I am trying to upload the below three components, JS and CSS in static resources to reference in VF page.

When I use like this, working great! no issues.

<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
    <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
    <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />

But when I use like this, create a zip file and then subfolders js and css then refrence the static resource in vf page is not working.

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

<apex:includeScript value="{!URLFOR($Resource.DataTable, 'js/jquery.dataTables.min.js')}"/>

<apex:stylesheet value="{!URLFOR($Resource.DataTable, 'css/jquery.dataTables.css')}"/>

 Please help me how to work them using as statis resource. Thanks,
sandeep@Salesforcesandeep@Salesforce
Hi MRDJ, 

To reference a file in an archive, use the URLFOR function. Specify the static resource name that you provided when you uploaded the archive with the first parameter, and the path to the desired file within the archive with the second. For example:
 
<apex:includeScript value="{!URLFOR($Resource.LibraryJSfiles, '/jsfolder/jssubfolder/file.js')}"/>

Can you please confirm again path of that file and also follow the correct format of the path as I have mentioned above.

Thanks 
Sandeep Singhal
http://www.codespokes.com/.
MRDJMRDJ
Hi Sandeep,

I have followed the same, but it didn't work. As I mentioned in my question.DataTable is zip file. After extract it has folders js and css
js subfolder contains the files jquery-1.11.1.min.js and jquery.dataTables.min.js
css subfolder contains the file jquery.dataTables.css

Based on this I have wrote as below

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

<apex:includeScript value="{!URLFOR($Resource.DataTable, 'js/jquery.dataTables.min.js')}"/>

<apex:stylesheet value="{!URLFOR($Resource.DataTable, 'css/jquery.dataTables.css'

This didn't work.
System Administrator 334System Administrator 334
Any updated resutls? Any workarounds?