function getCookie(name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return arr[2]; return null;
};
代码如下:
var currentServiceAliasName = getCookie("appName");
var displayName = "";
if (currentServiceAliasName != null && currentServiceAliasName != "" && currentServiceAliasName != "undefined")
displayName = decodeURIComponent(currentServiceAliasName) + " . " + counterName;
else
displayName = counterName;
decodeURIComponent 用这个转换一下