avoid potentially bad JS for...in
svn: r10883 original commit: 55f2387f931a4d52e5e012a357c5e5282fd4e362
This commit is contained in:
parent
c6a534f0b4
commit
e186bdee0f
|
@ -2,8 +2,8 @@
|
|||
|
||||
function GetCookie(key, def) {
|
||||
if (document.cookie.length <= 0) return def;
|
||||
var cookiestrs = document.cookie.split(/; */);
|
||||
for (var i in cookiestrs) {
|
||||
var i, cookiestrs = document.cookie.split(/; */);
|
||||
for (i = 0; i < cookiestrs.length; i++) {
|
||||
var cur = cookiestrs[i];
|
||||
var eql = cur.indexOf('=');
|
||||
if (eql >= 0 && cur.substring(0,eql) == key)
|
||||
|
|
Loading…
Reference in New Issue
Block a user