File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 91
91
this . get = function ( name ) {
92
92
var arg = name + '=' ,
93
93
aLength = arg . length ,
94
- cLength = document . cookie . length ,
94
+ cookie = document . cookie ,
95
+ cLength = cookie . length ,
95
96
i = 0 ,
96
97
j = 0 ;
97
98
98
99
while ( i < cLength ) {
99
100
j = i + aLength ;
100
101
101
- if ( document . cookie . substring ( i , j ) === arg ) {
102
+ if ( cookie . substring ( i , j ) === arg ) {
102
103
return this . getCookieVal ( j ) ;
103
104
}
104
- i = document . cookie . indexOf ( ' ' , i ) + 1 ;
105
+ i = cookie . indexOf ( ' ' , i ) + 1 ;
105
106
106
107
if ( i === 0 ) {
107
108
break ;
130
131
* @return {String }
131
132
*/
132
133
this . getCookieVal = function ( offset ) {
133
- var endstr = document . cookie . indexOf ( ';' , offset ) ;
134
+ var cookie = document . cookie ,
135
+ endstr = cookie . indexOf ( ';' , offset ) ;
134
136
135
137
if ( endstr === - 1 ) {
136
- endstr = document . cookie . length ;
138
+ endstr = cookie . length ;
137
139
}
138
140
139
- return decodeURIComponent ( document . cookie . substring ( offset , endstr ) ) ;
141
+ return decodeURIComponent ( cookie . substring ( offset , endstr ) ) ;
140
142
} ;
141
143
142
144
return this ;
You can’t perform that action at this time.
0 commit comments