3

I'm really new with Salesforce but I'm trying to add a Javascript to my Home Page components and I develop the Javascript which inject some values in the address (like Post code according with what city you choose). But I don't know what this means:

at the body enter {!REQUIRESCRIPT("/resource/1402932484000/YourStaticResourceName")}

I don't understand what those number means "1402932484000".

Thanks for your help.

2
  • I think you should just wrap 'YourStaticResourceName' in a URLFOR.
    – Adrian Larson
    Mar 4, 2015 at 23:51
  • @AdrianLarson - Never tried with URLFOR but could work, too.
    – Uwe Heim
    Mar 5, 2015 at 1:27

1 Answer 1

1

First of all: you can simply omit them. No harm done. So this should work, too:

    {!REQUIRESCRIPT("/resource/YourStaticResourceName")}

These numbers are timestamps (usually seconds past since the start of the UNIX epoche and that's around 1970)

Their reason is to prevent the resource from being loaded from the browser cache.

Why you might want that? Typically after you have changeded the resource content.

Simple usage: Start with any number. If you've changed the resource and want to make sure it's not loading from cache, just increase the number and clients will receive the current version.

Instead of manually incrementing, another patter is to auto generate them using date functions. Result would be that cache will never be used and the resource is always fresh.

I stripped this info from the main article about the workaround because it doesn't really matter for the concept at all.

1
  • Thanks is works omiting those number, I am new so I didn't know that. Thanks a lot.
    – MANUELAN00
    Mar 12, 2015 at 23:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .