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
Solved

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

Posted on 2006-07-12
2
346 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Firing an ASP.NET event on selection of a JQuery datepicker 4 30
Optimize simple Javascript code to use no repetitions 12 43
JS does not refresh 6 30
Do alert on select 6 13
This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

839 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