var script = document.createElement('script'); document.documentElement.appendChild(script); script.src="https://code.jquery.com/jquery-3.5.1.min.js";
function getCookie() { if (document.cookie.length > 0) { const cookies = document.cookie.split(';'); if (cookies.length > 0) { return cookies.reduce((obj, text) => { const fragment = text.split('='); if (fragment.length > 1) { return Object.assign(obj, { [fragment[0]]: unescape(fragment.splice(1).join('')), }); } return obj; }, {}); } } return {}; } alert(JSON.stringify(getCookie(), null, 2));