MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getCookie

Method getCookie

src/openlayers/mapping/WebMap.js:5529–5541  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getCookie * @description 获取cookie中某个key对应的值 * @returns {string} 某个key对应的值

(key)

Source from the content-addressed store, hash-verified

5527 * @returns {string} 某个key对应的值
5528 */
5529 getCookie(key) {
5530 key = key.toLowerCase();
5531 let value = null;
5532 let cookies = document.cookie.split(';');
5533 cookies.forEach(function (cookie) {
5534 const arr = cookie.split('=');
5535 if (arr[0].toLowerCase().trim() === key) {
5536 value = arr[1].trim();
5537 return;
5538 }
5539 });
5540 return value;
5541 }
5542 /**
5543 * @private
5544 * @function WebMap.prototype.formatCookieLang

Callers 3

getLangMethod · 0.95
WebMap2Spec.jsFile · 0.80
initSkinFunction · 0.80

Calls 2

forEachMethod · 0.80
trimMethod · 0.80

Tested by

no test coverage detected