473,394 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Cookie Question

This is not a a PC question but just a javascript one, this script is
used on webtv.
The cookie on this script can be split into 3 different memory's, what
I am trying to do is to be able to call up a total cookie count of all 3
memory's, so far I can get the count of only one at a time.
**I am not a real time scripter so some javascript is vague to me,
Thanks for any help. Joe

BTW: this tool is just a basic cookied testbed
http://web2jo.com/Testing/MemoBed.html

Jul 23 '05 #1
2 1145
I didn't test the code with the WebTV emulator so that will be up to you
okay?
You will also have to modify the code to loop through the collection of
cookies to get the count and so on and do whatever it is you need to do.
Have a good time...

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length; // total cookie count
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieValue (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
--
<%= Clinton Gallagher
METROmilwaukee "Regional Information Services"
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
"Papajo" <do*****@webtv.net> wrote in message
news:23***************@storefull-3336.bay.webtv.net...
This is not a a PC question but just a javascript one, this script is
used on webtv.
The cookie on this script can be split into 3 different memory's, what
I am trying to do is to be able to call up a total cookie count of all 3
memory's, so far I can get the count of only one at a time.
I am not a real time scripter so some javascript is vague to me,
Thanks for any help. Joe

BTW: this tool is just a basic cookied testbed
http://web2jo.com/Testing/MemoBed.html
Jul 23 '05 #2
Thanks for your responce, I'll work on that script.

I came up with this but I think it's giving you the total cookie count
for your domain, well thanks again, Joe

<input type="button" value="Cookie Count" onClick="alert('Cookie
Count='+document.cookie.length+'')">

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ralph Freshour | last post by:
I wrote a small .php script that creates a cookie on my local PC - I also wrote one that deletes it. My question is this: when the cookie has been created and I run the delete .php script, when...
6
by: Ajay | last post by:
hi! i am printing a simple cookie, but instead of printing um=name:blah&access:admin&exp:2312390.909 its printing um="name:blah&access:admin&exp:2312390.909" why the quotes?
1
by: koen colen | last post by:
Hello group, I hope you guys can help me out, I am modifying a piece of code from Joe Norman, I did found the code here: http://www.intranet2internet.com/public/default.asp?PAGE=sscript&ID=3 ...
1
by: Display Name | last post by:
Used one of these canned scripts to set up a JS quiz but not before having used another canned PHP script for "Tell your friend about this Web page!" sort of thing. Now i've gotta integrate them;...
7
by: What-a-Tool | last post by:
How does the expire date work setting it server side with asp. I know with javascript setting it client side it will be set to the clients local time, and therefore expire when the clients local...
7
by: odonel | last post by:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: here is my code: HttpCookie cookie = Request.Cookies;
15
by: Oleg Leikin | last post by:
Hi, (newbie question) I've created some simple .NET ASP application that should store cookies at the client machine. According to the documentation cookie expiration time is set via...
6
by: kelvlam | last post by:
Hello all, I'm still a bit new with JavaScript, and I hope the guru here can shed some light for me. It's regarding handling cookie and the case-sensitive nature of JavaScript itself. My...
3
by: Dan | last post by:
Hi, I am trying to refresh the cookie to make sure the timeout is reset by simply calling a blank page on my site. I am doing this because I have an external site hosted in my web that isn't...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.