Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alaca/localscript.js
Asynchronous JavaScript loader
https://github.com/alaca/localscript.js
async asynchronous javascript loader localscript localstorage
Last synced: about 1 month ago
JSON representation
Asynchronous JavaScript loader
- Host: GitHub
- URL: https://github.com/alaca/localscript.js
- Owner: alaca
- Created: 2017-11-07T22:43:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T17:33:27.000Z (almost 7 years ago)
- Last Synced: 2024-12-23T11:52:02.663Z (about 2 months ago)
- Topics: async, asynchronous, javascript, loader, localscript, localstorage
- Language: JavaScript
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Localscript.js
Localscript.js is asynchronous JavaScript loader inspired by Cloudflare Rocket Loader### Features
* Ensures that all the scripts on your page will not block the content of your page from loading
* Loads all the scripts on your page asynchronously
* Uses browser's localStorage to store scripts so they aren't refetched unless necessary### Usage
All script tags must have type attribute set to **text/localscript**
```javascriptconsole.log('hello from localscript');
```
External JavaScript files must have **data-src** attribute instead of src attribute
```javascript```
**How to include localscript.js**
```javascript```
**Expire attribute**
```javascript```
Cache scripts for 1800 seconds (30 minutes)
Default value is 3600
**Cache attribute**
```javascript```
Disable caching