Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Burnt cookies
- From: javascript@xxxxxxxxxx (Peter Brunone)
- Subject: [Javascript] Burnt cookies
- Date: Thu, 24 May 2001 10:10:57 -0500
Can you suck in one of those unknown values by grabbing one that has a known position in the string? Then you could just walk your way through the string based on the wacky delimiters (which I think was your objective anyway). ----- Original Message ----- From: "Steve Hearne" <steve.hearne@xxxxxxxxxxxxx> To: <javascript@xxxxxxxxxx> Sent: Thursday, May 24, 2001 9:48 AM Subject: [Javascript] Burnt cookies Phew. I wouldn't have thought cookies could be so haaaaaard! Please help me as i am struggling. I would like to read the 20th item in a cookie when a user hits the page which generates that cookie. The items appear to be separated with ''ESC' characters (they appear as black squares in Notepad) but I am not to sure. Any help gratefully received. Thanks, Steve >>> steve.hearne@xxxxxxxxxxxxx 05/24/01 03:00PM >>> Thanks for the help so far. I've just realised that, because my page is split into 3 frames, i'm not sure which of these frames will have access to the URL - if any? Steve >>> gassinaumasis@xxxxxxxxxxx 05/23/01 04:24PM >>> >http://servername/servlet/WebClient/main?user=stevehearne&pass=mypassword&s erver=127.0.0.1 > >Now, when a user has to,for instance fill out a form, then I'd really like >to be able to know what their username is...Can i parse this URL with >JavaScript once they've arrived at the homepage in order to discover their >username? Sure var x = location.search; var y =new Array(); y = x.split('&'); Now the array y contains the name/value pairs of the query string. To find the user name, do for (i=0;i<y.length;i++) { if (y[i].indexOf('user') == 0) { var z = new Array(); z = y[i].split('='); username = z[1]; } } and the username is in variable 'username'. ppk _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx http://www.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx http://www.LaTech.edu/mailman/listinfo/javascript _______________________________________________ Javascript mailing list Javascript@xxxxxxxxxx http://www.LaTech.edu/mailman/listinfo/javascript
- References:
- [Javascript] Burnt cookies
- From: Steve Hearne
- [Javascript] Burnt cookies
- Prev by Date: [Javascript] Burnt cookies
- Next by Date: [Javascript] Half-baked cookies
- Previous by thread: [Javascript] Burnt cookies
- Next by thread: [Javascript] Half-baked cookies
- Index(es):