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
ryanelkinsryanelkins 

Is there a safe way to access static resources outside of Apex?

I would like to use static resources but I need to reference them from a home page component. Since you can't (easily) use Apex in a home page component, how would you go about doing this safely? Is there a hardcoded URL that won't have stale cache issues? Even if there wasn't - is there an easy way to get the correct URL if this component is part of a package - meaning that I don't know the domain it will be on or even the hardcoded path programatically?

 

Oh, BTW, you guys should really make it much easier to use VisualForce in a narrow home page component. Only being able to use raw HMTL has driven me to have to create some crazy workarounds and hacks. Also, the editor for that thing makes me hate lie, FYI.

IspitaIspita

Why are you finding issues in using apex in home page components? 

One can easily add VF page in an HTML Area based home components.   

ryanelkinsryanelkins

I assume you mean through the use of an iframe as that's the only way I've seen people be able to do it. Unfortunately the iframe causes other issues for my particular situation that disqualify it as a potential solution.

 

To focus back on the original question - is there a safe way to access static resources directly, outside of apex code, using pure html or javascript?