File tree Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Expand file tree Collapse file tree 1 file changed +9
-21
lines changed Original file line number Diff line number Diff line change @@ -45,16 +45,10 @@ class JBase extends Array{
45
45
return this ;
46
46
}
47
47
val ( arg ) {
48
- if ( arg ) {
49
- this . each ( function ( e ) {
50
- e . value = arg ;
51
- } ) ;
52
- }
53
- else {
54
- this . each ( function ( e ) {
55
- return e . value ;
56
- } ) ;
57
- }
48
+ if ( arg )
49
+ this [ 0 ] . value = arg ;
50
+ else
51
+ return this [ 0 ] . value ;
58
52
return this ;
59
53
}
60
54
hasClass ( arg ) {
@@ -70,16 +64,10 @@ class JBase extends Array{
70
64
return this ;
71
65
}
72
66
attr ( att , val = null ) {
73
- if ( val ) {
74
- this . each ( function ( e ) {
75
- e . setAttribute ( att , val ) ;
76
- } ) ;
77
- }
78
- else {
79
- this . each ( function ( e ) {
80
- e . getAttribute ( att ) ;
81
- } ) ;
82
- }
67
+ if ( val )
68
+ this [ 0 ] . setAttribute ( att , val ) ;
69
+ else
70
+ return this [ 0 ] . getAttribute ( att ) ;
83
71
return this ;
84
72
}
85
73
removeAttr ( arg ) {
@@ -302,6 +290,7 @@ $.ajax = function(arg){
302
290
let type = "get" ;
303
291
let success = function ( ) { } ;
304
292
let fail = function ( ) { } ;
293
+ let param ;
305
294
if ( arg [ 'success' ] ) {
306
295
success = arg [ 'success' ] ;
307
296
}
@@ -326,7 +315,6 @@ $.ajax = function(arg){
326
315
else
327
316
return fail ( this . status ) ;
328
317
} ;
329
- let param = "" ;
330
318
if ( arg ) {
331
319
type = arg [ "type" ] ;
332
320
if ( 'data' in arg ) {
You can’t perform that action at this time.
0 commit comments