You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-15Lines changed: 26 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ Many plugins and libraries are too generic, verbose, bulky, lacking, or have a l
7
7
Much of what is included here is stuff that I've written several times, in several different ways, using jQuery in the past (or wrapping other jQuery plugins).
8
8
The goal of this library is to allow me (and you, now that it's open source) to integrate slim, mostly dependency-free, components as-needed with more specific use-cases than what is currently offered elsewhere.
9
9
10
-
...where else can you get a component to grab a form from another page and stick it on the current one with XHR and XHR submission in [6 lines of custom JS](#6lineofjs)?
10
+
...where else can you get a component to grab a form from another page and stick it on the current one with XHR and XHR submission in [3 lines of custom JS](#3lineofjs)?
11
11
12
12
<h1id="whatsincluded">What's Included</h1>
13
13
@@ -264,8 +264,11 @@ var remote_form = new XHRForm(document.getElementById('my-form'), {
264
264
xhrSubmit:true, //wouldn't make a whole lotta sent to use this if this were false lol, but it's here for extending classes and incase you want to toggle it for whatever reason
265
265
submitURL:null, //when null, the form's action will be used (if explicitly defined), otherwise it falls back to the URL the form was retrieved from
266
266
submitMethod:null, //when null, the form's method will be used (if explicitly defined), otherwise it falls back to POST
267
-
onError:function(error, response, form){ }, //although you can add more, you can only pass 1 to start with in the constructor
268
-
onSuccess:function(response, form){ }, //although you can add more, you can only pass 1 to start with in the constructor
267
+
onError:function(error, response, form){ alert(error); }, //although you can add more, you can only pass 1 to start with in the constructor
268
+
onSuccess:function(response, form){ //although you can add more, you can only pass 1 to start with in the constructor
0 commit comments