Giter Site home page Giter Site logo

intercooler-js's Introduction

Intercooler.js

What it is

Intercooler is a PVC framework that allows you to add AJAX to your application with declarative HTML5-style bindings and REST-ful URLs, giving web applications a richer UX with a minimum of code.

What that means

It makes AJAX simple, you don't even need to write any JavaScript! Here's an example of a basic POST request:

// When this is clicked, a post request is sent to /example
<button ic-post-to="/example">
    Click Me!
</button>

// When a post request is sent to /example, the response goes here
<span ic-src="/example"></span>

How to use

Intercooler depends on JQuery and can be installed like this:

<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="https://s3.amazonaws.com/intercoolerjs.org/release/intercooler-0.0.1.min.js"></script>

Or you can download the latest version and embed it locally.

More examples

Polling

Send a GET request to "/visitors/count" every two seconds and update the innerHTML to the response:

<div ic-src="/visitors/count" ic-poll="2s">
    There are currently 42 users online.
</div>

Adding input

This AJAX includes the value of #password in it's request.

Enter a password: <input id="password" name="pass">

<button ic-post-to="/hash/sha256" ic-include="#password">
    Hash password
</button>

<div ic-src="/hash/sha256">
    Your hashed password will go here
</div>

Learn more at intercoolerjs.org (there's lots more!).

Versioning

We have adopted Semantic Versioning for IntercoolerJS as of the 0.2.0 release.

intercooler-js's People

Contributors

coffeecodecouch avatar

Watchers

 avatar  avatar  avatar

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.