Solved

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

Posted on 2006-07-12
2
344 Views
Last Modified: 2008-03-06
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");

0
Comment
Question by:Dalkalion
2 Comments
 
LVL 17

Expert Comment

by:gops1
ID: 17096306
You are missing a brace "{"

function getCookieArray(Thumbc){
0
 
LVL 8

Accepted Solution

by:
kaliyugkaarjun earned 500 total points
ID: 17097109
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now