@@ -624,6 +624,8 @@ describe('form', function() {
624624
625625
626626 it ( 'fieldValue(true)' , function ( ) {
627+ var i ;
628+
627629 assert . ok ( '5' == $ ( '#fieldTest input' ) . fieldValue ( true ) [ 0 ] , 'input' ) ;
628630 assert . ok ( '1' == $ ( '#fieldTest :input' ) . fieldValue ( true ) [ 0 ] , ':input' ) ;
629631 assert . ok ( '5' == $ ( '#fieldTest input:hidden' ) . fieldValue ( true ) [ 0 ] , ':hidden' ) ;
@@ -634,19 +636,21 @@ describe('form', function() {
634636 var expected = [ '8' , '10' ] ;
635637 var result = $ ( '#fieldTest :checkbox' ) . fieldValue ( true ) ;
636638 assert . ok ( result . length == expected . length , 'result size check (checkbox): ' + result . length + '=' + expected . length ) ;
637- for ( var i = 0 ; i < result . length ; i ++ ) {
639+ for ( i = 0 ; i < result . length ; i ++ ) {
638640 assert . ok ( result [ i ] == expected [ i ] , expected [ i ] ) ;
639641 }
640642
641643 expected = [ '3' , '4' ] ;
642644 result = $ ( '#fieldTest [name=B]' ) . fieldValue ( true ) ;
643645 assert . ok ( result . length == expected . length , 'result size check (select-multiple): ' + result . length + '=' + expected . length ) ;
644- for ( var i = 0 ; i < result . length ; i ++ ) {
646+ for ( i = 0 ; i < result . length ; i ++ ) {
645647 assert . ok ( result [ i ] == expected [ i ] , expected [ i ] ) ;
646648 }
647649 } ) ;
648650
649651 it ( 'fieldValue(false)' , function ( ) {
652+ var i ;
653+
650654 assert . ok ( '5' == $ ( '#fieldTest input' ) . fieldValue ( false ) [ 0 ] , 'input' ) ;
651655 assert . ok ( '1' == $ ( '#fieldTest :input' ) . fieldValue ( false ) [ 0 ] , ':input' ) ;
652656 assert . ok ( '5' == $ ( '#fieldTest input:hidden' ) . fieldValue ( false ) [ 0 ] , ':hidden' ) ;
@@ -656,21 +660,21 @@ describe('form', function() {
656660 var expected = [ '8' , '9' , '10' ] ;
657661 var result = $ ( '#fieldTest :checkbox' ) . fieldValue ( false ) ;
658662 assert . ok ( result . length == expected . length , 'result size check (checkbox): ' + result . length + '=' + expected . length ) ;
659- for ( var i = 0 ; i < result . length ; i ++ ) {
663+ for ( i = 0 ; i < result . length ; i ++ ) {
660664 assert . ok ( result [ i ] == expected [ i ] , expected [ i ] ) ;
661665 }
662666
663667 expected = [ '11' , '12' , '13' ] ;
664668 result = $ ( '#fieldTest :radio' ) . fieldValue ( false ) ;
665669 assert . ok ( result . length == expected . length , 'result size check (radio): ' + result . length + '=' + expected . length ) ;
666- for ( var i = 0 ; i < result . length ; i ++ ) {
670+ for ( i = 0 ; i < result . length ; i ++ ) {
667671 assert . ok ( result [ i ] == expected [ i ] , expected [ i ] ) ;
668672 }
669673
670674 expected = [ '3' , '4' ] ;
671675 result = $ ( '#fieldTest [name=B]' ) . fieldValue ( false ) ;
672676 assert . ok ( result . length == expected . length , 'result size check (select-multiple): ' + result . length + '=' + expected . length ) ;
673- for ( var i = 0 ; i < result . length ; i ++ ) {
677+ for ( i = 0 ; i < result . length ; i ++ ) {
674678 assert . ok ( result [ i ] == expected [ i ] , expected [ i ] ) ;
675679 }
676680 } ) ;
@@ -809,11 +813,13 @@ describe('form', function() {
809813
810814 // expect(0);
811815 // multiple binds
812- $ ( '#form9' ) . ajaxForm ( opts ) . submit ( function ( ) { return false ; } ) ;
816+ $ ( '#form9' ) . ajaxForm ( opts ) . submit ( function ( ) {
817+ return false ;
818+ } ) ;
813819 $ ( '#form9' ) . ajaxFormUnbind ( opts ) ;
814820 $ ( '#submitForm9' ) [ 0 ] . click ( ) ;
815821
816- setTimeout ( start , 500 ) ;
822+ // setTimeout(start, 500);
817823 } ) ;
818824
819825 it ( 'naked hash' , function ( ) {
@@ -850,23 +856,25 @@ describe('form', function() {
850856 } ) ;
851857
852858 it ( 'success callback params' , function ( ) {
859+ var $testForm ;
860+
853861 $ ( '#targetDiv' ) . empty ( ) ;
854862 // stop();
855863
856864 if ( / ^ 1 \. 3 / . test ( $ . fn . jquery ) ) {
857865 // expect(3);
858- var $testForm = $ ( '#form3' ) . ajaxSubmit ( {
866+ $testForm = $ ( '#form3' ) . ajaxSubmit ( {
859867 success : function ( data , status , $form ) { // jQuery 1.4+ signature
860868 assert . ok ( true , 'success callback invoked' ) ;
861869 assert . ok ( status === 'success' , 'status === success' ) ;
862870 assert . ok ( $form === $testForm , '$form param is valid' ) ;
863871 // start();
864872 }
865873 } ) ;
866- }
867- else { // if (/^1\.4/.test($.fn.jquery)) {
874+
875+ } else { // if (/^1\.4/.test($.fn.jquery)) {
868876 // expect(6);
869- var $testForm = $ ( '#form3' ) . ajaxSubmit ( {
877+ $testForm = $ ( '#form3' ) . ajaxSubmit ( {
870878 success : function ( data , status , xhr , $form ) { // jQuery 1.4+ signature
871879 assert . ok ( true , 'success callback invoked' ) ;
872880 assert . ok ( status === 'success' , 'status === success' ) ;
0 commit comments