Js gets the specific implementation of the specified cookie
var cookieName = "cookie The name ";var cookieValue = null;//Returns the value of the cookieif (document.cookie && document.cookie != '') {var cookies = document.cookie.split(';');//Cut all the obtained cookies into an arrayfor (var i = 0; i < cookies.length; i++) {var cookie = cookies[i];//Gets an array of cookies for a certain indexif (cookie.substring(0, cookieName.length + 2).trim() == cookieName.trim() + "=") {//If the cookie exists, the value of the cookie is pulled outcookieValue = cookie.substring(cookieName.length + 2, cookie.length);break}}}if (cookieValue != "" && cookieValue != null) {//If the specified cookie value existsalert(cookieValue);} else {<span style="font-family: Arial, Helvetica, sans-serif;">//If the value of the cookie is null </ span>alert("not cookie!!!");}
//Remove the blank spaceString.prototype.trim = function () {return this.replace(new RegExp("(^[\s]*)|([\s]*$)", "g"), "");}