Link to home
Start Free TrialLog in
Avatar of Dalkalion
Dalkalion

asked on

Trying to get cookie array and I get an object expected error

I'm trying to get cookie array and I get an object expected error on line 9
 var l = 0;
If my cookies are "undefined" will this cause this error?

Here is my code:
    function getCookieArray(Thumbc)
    var i = 0;
        while (getCookie(Thumbc + i) != null) {
        this[i + 1] = getCookie(Thumbc + i);
        i++; this.length = i;
        }
    }
    function getCookieArray(Titlec){
    var l = 0;
        while (getCookie(Titlec + l) != null) {
        this[l + 1] = getCookie(Titlec + l);
        l++; this.length = l;
        }
    }
   
var ThumbArray = new getCookieArray("Thumbc");
var TitleArray = new getCookieArray("Titlec");

Avatar of gops1
gops1
Flag of United States of America image

You are missing a brace "{"

function getCookieArray(Thumbc){
ASKER CERTIFIED SOLUTION
Avatar of kaliyugkaarjun
kaliyugkaarjun

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial