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");

DalkalionAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
kaliyugkaarjunConnect With a Mentor Commented:
I f gops1's comment doesn't giv solution to u. Then may be if u want u can try this javascript cookie class .

http://www.codepost.org/view/135
0
 
gops1Commented:
You are missing a brace "{"

function getCookieArray(Thumbc){
0
All Courses

From novice to tech pro — start learning today.