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
hemmhemm 

Referencing Salesforce CSS & JS files on salesforce.com rather than locally on my web server

I am writing some PHP pages for a client that will run on their own web server and use the SOAP API to talk to Salesforce.com.  These scripts will have a Salesforce-esque UI and I want to leverage Salesforce's CSS and JS files to do this, similar to how I would when writing an s-Control and following the guidelines here. What is the protocol for referencing CSS and JS files from the salesforce.com domain vs. storing them locally when writing scripts that reside on my own web server?  I originally tried storing copies locally, but was having issues rendering the related lists properly (I think the CSS files use some relative links. ) Is it okay for an app like this to use the following in the header of its pages? Code:
<link href="https://na1.salesforce.com/dCSS/Theme2/default/common.css" rel="stylesheet" type="text/css" media="handheld,print,projection,screen,tty,tv">
<link href="https://na1.salesforce.com/dCSS/Theme2/default/custom.css" rel="stylesheet" type="text/css" media="handheld,print,projection,screen,tty,tv">
<script type="text/javascript" src="https://na1.salesforce.com/js/functions.js"></script>
<script type="text/javascript" src="https://na1.salesforce.com/js/setup.js"></script>
<script type="text/javascript" src="https://na1.salesforce.com/js/roletreenode.js"></script>
On a similar note, Yahoo recently began hosting their Yahoo User Interface toolkit (which I am also using).  Using this, you reference scripts on the yahoo servers rather than storing your own local copies.  I am basically asking if Salesforce is doing something similar with their CSS and JS files whereby these locations can be counted on, won't be changing and are supported. If it's okay to reference these files from the salesforce.com domain, my second question would be whether I have the correct paths or whether Salesforce uses a path that includes version numbers for backwards compatibility. Thanks.

Message Edited by hemm on 03-28-2007 06:48 PM

Best Answer chosen by Admin (Salesforce Developers) 
smsm
Solution1 : As per Salesforce techincal specification documentation on CSS ...
1. All salesforce.com CSS files can be found in the "dCSS" directory.
2. There are two themes available "theme1" and "theme2". So I feel what you are using could be safe for future versions...
3. Use "default" to refer to the default language used by the user. So I think your code is pretty safe.
Just an advise that you dont use
"https://na1.salesforce.com" in the href's and src's

Remove the above text and you would be safe of the domain changes also :)

i.e., use the urls as
<link href="/dCSS/Theme2/default/common.css" rel="stylesheet" type="text/css" media="handheld,print,projection,screen,tty,tv">
<link href="/dCSS/Theme2/default/custom.css" rel="stylesheet" type="text/css" media="handheld,print,projection,screen,tty,tv">
<script type="text/javascript" src="/js/functions.js"></script>
<script type="text/javascript" src="/js/setup.js"></script>
<script type="text/javascript" src="/js/roletreenode.js"></script> 


Solution 2: Other option could be to copy the classes and put it in your HTML .

Thx Sanjeev

Message Edited by sm on 03-30-2007 06:19 AM