GithubHelp home page GithubHelp logo

angelogeminiani / smartlib Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 176 KB

Smart Lib (sf-lib.js) is a stand-alone script-loader that handles caching scripts in localStorage where supported.

Home Page: http://www.smartfeeling.org/smartlib

JavaScript 100.00%

smartlib's Introduction

Smart Lib

Smart Lib (sf-lib.js) is a stand-alone script-loader that handles caching scripts in localStorage where supported. Try it here at Smart Lib test page.

Quick Start

Please, visit SmartLib site for more details and news.

Start with SmartLib is very easy:

1) Add sf-lib.js to your HTML page.

<script type="text/javascript" src="sf-lib.js"></script> 

2) Use it in a <script> tag.

<script>
        SFlib.require('./lib/vendor/jquery-1.7.1.js');
        
        SFlib.require('http://fonts.googleapis.com/css?family=Nobile:regular,italic,bold&amp;subset=latin', {'media':'only screen'});
        
        // test jQuery
        $(function(){
            $('#test').html('Success! all libraries are loaded');
        });
</script>

Cache invalidation

When you deploy new version of your cached scripts, you need to refresh cache. This can be done simply changing value of "VERSION" variable in sf-lib.js. Default value is:

VERSION = '[RT-VERSION]'

[RT-VERSION] is a SmartForge Framework pre-processor directive and is automatically updated when SmartForge deploy new version of you packages. Even if you are not developing on SmartForge, you can take advantage from Smart Lib.

Remember to manually change value of VERSION variable each time you need cache is refreshed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.