Socket
Book a DemoInstallSign in
Socket

jquery-expire

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

jquery-expire

jQuery plugin to check to see whether a page has expired and, if so, performs an action.

unpublished
latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

expire

Description

Checks to see whether a page has expired or not. Checks current timestamp on load and at a specified interval (default 1 second) against specified start and end times. Can use client's local time or pull from atomic clock. Can use local timezone's for each client, or specified absolute timezone.

Usage

  • Include jQuery
  • Include jquery.expire.js
  • Call $.expire(); with startTime, endTime, and expireAction

Options

startTime
date
required
Date when you want the page to become active. If timeStamp is before startTime, expireAction will be called.

endTime
date
required
Date when you want the page to expire. If timeStamp is on or after endTime, expireAction will be called.

expireAction
function
required
This function is called when timeStamp is outside range of startTime and endTime. A common usage would be to redirect the page with window.location.

updateInterval integer
optional
default: 1000
Interval, in milliseconds, the script will check whether the page is expired or not. The script will automatically check on page load, then every updateInterval.

useAtomicTime
boolean
optional
default: false
If true, the timeStamp will be updated via AJAX to the atomic time in the timezone specified with the timeZone option.

timeZone
string
optional
default: 'local'
Can be any timezone listed on http://json-time.appspot.com/timezones.json. If set to 'local' (default), the timezone will be checked via AJAX based on the client's IP address geolocation information. Keep in mind that the page will expire for different clients depending on what timezone they are in. Setting an absolute timezone will expire the page for everyone at the same time globally.

Known & Possible Bugs

  • checkExpiration() doesn't seem to see the update when the time is updated to atomic time via AJAX; probably because setInterval is called before the async action is completed.
  • Not all timezones pulled from IPInfoDB have been checked to proved whether they convert correctly with the convertTZ() function.

Keywords

jquery-plugin

FAQs

Package last updated on 25 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts