Skip to content
This repository has been archived by the owner on Jun 27, 2020. It is now read-only.

en JWSDK.getTimestamp

Egor Nepomnyaschih edited this page Oct 4, 2015 · 4 revisions

<< JavaScript API

Function JWSDK.getTimestamp(resourceName:String):Integer

Returns resource modification date in Unix Timestamp format.

The resource must be registered in current package config. The resource is registered by its inclusion into timestamps list in package config.

{
    ...
    "timestamps" : [
        "application/videoPlayer.swf"
    ]
    ...
}

Function is used to prevent resource taking from browsers cache, if it was modified on the server.

Example

var resourceName = "application/videoPlayer.swf";
var url = "/" + resourceName + "?_dc=" + JWSDK.getTimestamp(resourceName);

Arguments

resourceName

resourceName:String

Required argument. Resource name (path relative to document root folder).

Result

return:Integer

Resource modifiction date in Unix Timestamp format.