Hi friends today I wrote a small javascript function to get cookie value based on cookie name please check the below function.
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return '';
}
Please Share this if you like myblog:
Related
Published by Bunchofknowledge
I am a freelancer,blogger and a web designer with substantial information with user friends design skills.I mostly deal with web development,Application development i have a working knowledge on php,vb.net,html,js,css. I am person who has high passion in learning technologies. I love my work and enjoy each new project as I get it.So now you know a bit about me check out my blog,or if you are really interested head over to my contact area and shoot me an email.
View all posts by Bunchofknowledge