forked from nervetattoo/jquery-autosave
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
30 lines (26 loc) · 1.05 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
jQuery Autosave Plugin
Written by Mads Erik Forberg ([email protected]) and Raymond Julin ([email protected])
Licensed under the BSD License
Usage:
$("input.autosave").autosave({
url: url, // Defaults to parent form url or window.location.href
method: "post", // Defaults to parent form url or get
grouped: true, // Defaults to false. States whether all "input.autosave" should be sent in the request or only the one it was triggered upon
success: function(data) {
console.log(data);
},
dataType: "json", // Defaults to JSON, but can be XML, HTML and so on
send: function() {
// Do stuff while we wait for the ajax response, defaults to doing nothing
console.log("Saving");
},
error: function(xmlReq, text, errorThrown) {
// Handler if the ajax request fails, defaults to console.log-ing the ajax request scope
console.log(text);
}
});
// Submits entire form each time one of the
// elements are changed
$("form#myForm").autosave();
Todo:
- Support timed autosave for textareas