File tree 1 file changed +18
-18
lines changed
1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change 29
29
< button > Submit</ button >
30
30
31
31
< script type ="text/javascript ">
32
- $ ( document ) . ready ( function ( ) {
33
- $ ( 'button' ) . bind ( 'click' , function ( ) {
34
- $ . post ( '/?ts=' + new Date ( ) . getTime ( ) , $ ( '#f' ) . serialize ( ) , function ( d ) {
35
- var err = $ ( '#error' ) ;
36
-
37
- if ( d instanceof Array ) {
32
+ $ ( document ) . ready ( function ( ) {
33
+ $ ( 'button' ) . bind ( 'click' , function ( ) {
34
+ $ . post ( '/?ts=' + new Date ( ) . getTime ( ) , $ ( '#f' ) . serialize ( ) , function ( d ) {
35
+ var err = $ ( '#error' ) ;
36
+ d = JSON . parse ( d ) ;
37
+ if ( d instanceof Array ) {
38
38
39
- err . empty ( ) ;
40
- d . forEach ( function ( o ) {
41
- err . append ( '<div>' + o . error + '</div>' ) ;
42
- } ) ;
43
- err . show ( ) ;
44
- return ;
45
- } ;
39
+ err . empty ( ) ;
40
+ d . forEach ( function ( o ) {
41
+ err . append ( '<div>' + o . error + '</div>' ) ;
42
+ } ) ;
43
+ err . show ( ) ;
44
+ return ;
45
+ } ;
46
46
47
- err . hide ( ) ;
48
- alert ( 'Form is valid.' ) ;
49
- } ) ;
50
- } ) ;
51
- } ) ;
47
+ err . hide ( ) ;
48
+ alert ( 'Form is valid.' ) ;
49
+ } ) ;
50
+ } ) ;
51
+ } ) ;
52
52
</ script >
You can’t perform that action at this time.
0 commit comments