1600 PMP mock questions 1400 CAPM mock questions 800 SCJP 6 mock questions 600 OCAJP 7 mock questions 590 OCPJP 7 mock questions 556 SCWCD 5 mock questions 500 OCEJWCD 6 mock questions pdfDownload (java,struts, hibernet etc)

Java Script Tutorials

read cookies example javascript

<html><head><title>Reading the Cookie</title>

<script language="JavaScript">
<!-- hide me

function readCookie()


var the_cookie = document.cookie;

var the_cookie = unescape(the_cookie);

var broken_cookie = the_cookie.split(":");

var the_name = broken_cookie[1];

alert("Your name is: " + the_name);


function WM_readCookie(name) {

// if there's no cookie, return false else get the value and return it

if(document.cookie == '') return false;
else return unescape(WM_getCookieValue(name));


function WM_getCookieValue(name)
// Declare variables.
var firstChar, lastChar;

// Get the entire cookie string. (This may have other name=value pairs in it.)
var theBigCookie = document.cookie;

// Grab just this cookie from theBigCookie string.

// Find the start of 'name'.
firstChar = theBigCookie.indexOf(name);

// If you found it,
if(firstChar != -1)
// skip 'name' and '='.
firstChar += name.length + 1;

// Find the end of the value string (i.e. the next ';').
lastChar = theBigCookie.indexOf(';', firstChar);

if(lastChar == -1) lastChar = theBigCookie.length;

// Return the value.
return theBigCookie.substring(firstChar, lastChar);

} else {
// If there was no cookie, return false.
return false;

// show me-->

<h3>Reading the Cookie</h3>
The information
you entered on the last page is now saved on your
hard drive.
Click here
<a href="#" onClick="readCookie(); return false;">read the
off your hard drive. This information will stay on your hard
even after you quit out of your browser. Try it. Quit your browser,
and then
come back to this page and hit the link. It'll still remember
your name.
Neat, eh?
When you're done, continue with the cookie


Reviews and Comments

PMP, CAPM, PMI is a registered certification mark of the Project Management Institute, Inc

Copyright © www.techfaq360.com 2019

About US | Contact US | Privacy Policy | Terms and Conditions  | Website disclaimer  | Cancellation and Refund Policy  | Shipping & Delivery Policy