• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Create a cookie using JqueryToday I told you the fact creating cookie.Creating cookie is often we need when wedevelop the site.Here I told you how to create a cookie .Creating a cookie in Jquery is very simple than other languages.But for creating a cookieyou need the plugin you can download it from the following link.http://plugins.jquery.com/files/jquery.cookie.js.txt Now create the file and test the cookie value<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title><script type="text/javascript" src="jquery/jquery.js"></script><script type="text/javascript" src="jquery/cookie.js"></script><script type="text/javascript">$(document).ready(function(){$.cookie("example","mycookie");});</script></head><body><?php echo $_COOKIE["example"];?></body></html>Run the above code will give result of cookie value. The$.cookie("example","mycookie"); means example give name to cookie,mycookie is thevalueMy cookie is printed on the page.You can delete the cookie by$.cookie("example", null);
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...