GithubHelp home page GithubHelp logo

areyousure.js's Introduction

AreYouSure.js

jQuery plugin to check for unsaved changes before leaving a page.

Installation

Download

Download and estract the files to your project, and include:

<script type="text/javascript" src="path/jquery.min.js"></script>
<script type="text/javascript" src="path/jquery.areYouSure.min.js"></script>

Bower

$ bower install jquery.areYouSure --save

Methods

Method Description
reload Method to reinitialise the script, and refresh the pre-stored data.
remove Unbind/remove listener from element(s)

Usage

How to bind listener(s)

// Bind to all form elements
$('form').areYouSure();

// Bind to form elements except those with class a and/or b
$('form').areYouSure({except: '.a, .b'});

// Bind to specific element(s) with class
$('.element-with-class').areYouSure();

Custom warning:

$('form').areYouSure({
    warningText: 'You have made unsaved changes. Are you sure you want to leave?'
});

Reload pre-stored data

$('form').areYouSure('reload');

Remove listener(s)

$('form').areYouSure('remove');

Authors

Nikolaj Løvenhardt

areyousure.js's People

Contributors

nikolajlovenhardt avatar

Watchers

James Cloos avatar  avatar

Forkers

atouhou

areyousure.js's Issues

Reload method

Reload method to change initial value

$elm.areYouSure('reload');

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.