Git Product home page Git Product logo

seemly.js's Introduction

Seemly.js - Ajaxify your forms ASAP

Everyone hates forms that reload the entire page on submission, they really screw up the UX. And converting these forms into dynamic ajax based forms is usually a headache as well. Seemly.js takes care of that seamlessly.

So what does it do?

It automagically converts simple web forms (PHP, ASP.NET, Node, Rails, etc...) into dynamic ajax based forms without changing a single line of your JS code.

Installation

Simply add these two libraries to your page (besides jQuery).

<script type="text/javascript" src="/path/to/diffDOM.min.js"></script>
<script type="text/javascript" src="/path/to/seemly.min.js"></script>

Express setup

Just add the attribute data-seemly-express to your script tag. Like this:

<script type="text/javascript" src="/path/to/seemly.min.js" data-seemly-express></script>

It would automatically upgrade all your forms.

Customized setup

Add data-seemly attribute to the forms you want to ajaxify. Then add data-seemly-preloader-text attribute to the elements that will show the preloading status.

<form data-seemly>
	<input type='textbox' />
	<input type='button' value='Submit' data-seemly-preloader-text='Loading...' />
</form>

You can also add data-seemly-preloader-class to an element to show a preloading animation (check out the example).

Note

Only the elements within the form tag would be updated. This is a feature to prevent unwanted changes effecting the page.

Why Seemly.js is awesome

  • Incredibly simple way to upgrade forms.
  • No need to customize your client or server side code.
  • Works with any type of server (PHP, ASP.NET, Node, Java, Rails). You name it!
  • Allows file uploads as well.
  • Natural fallback. If JavaScript is disabled, it won't hurt a bit.
  • Tiny, 3KB when minified (optional diffDOM, 12KB when minified).

Examples

Attributes

  • data-seemly [values: undefined|diff|replace]

    diff option would use the diff algo diffDOM.js to do the replacements. replace would trigger simple HTML replacement (not a good idea for JavaScript hooked elements).

  • data-seemly-preloader-text [values: undefined|string]

    Used to mark the elements (divs, inputs, etc...) for showing the ajax status.

  • data-seemly-preloader-class [values: undefined|string]

    This class would be activated to the element when the ajax is being carried out. Good for showing preloader animations (check out the example).

Limitations

  • Not thoroughly tested at this moment (status: beta).
  • May cause issues with JavaScript heavy forms.

Contribution

Please submit bug reports, suggestions and pull requests to the GitHub issue tracker.

Changelog

Details changes for each release will be documented in the release notes.

Stay In Touch

For latest releases and announcements, check out my site: aliashraf.net

License

This software is released under the MIT License. Please read LICENSE for information on the software availability and distribution.

Copyright (c) 2015 Ali Ashraf

seemly.js's People

Contributors

aliflux avatar

Stargazers

Christ Prateek Prasanna Xaxa avatar Ahmad Awais โŒ˜ avatar Tashfeen avatar

Watchers

 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.