How can i get Client Webpage cookie information through javascript
I want to get the browser cookies information开发者_Python百科 like email or name.
pls help me
You can use the document.cookie
object to read the available cookies using javascript.
You can find more details here.
One thing you need to keep in mind is you cannot get a cookie which has a different domain than yours.
Have a look at this..
http://www.yourhtmlsource.com/javascript/cookies.html
Though this cookie method is in the context of jQuery, the actual JS is regular JS, aside from a jQuery.trim method (which you can a substitution at crockford's site. Overall, it's a good way to set/get/delete cookies.
This cookie method is also jquery-dependent, especially with the jQuery.extend (whole different story than the jQuery.trim method), but it looks much more succinct than the other cookie method. I haven't personally used this one, so i can't speak much for it.
精彩评论