Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2006-07-12
2
Medium Priority
?
351 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 1500 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

688 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