Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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**
```javascript

console.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