javascript - 在 cookie 中使用 javascript 临时保留更改
问题描述
我正在尝试进行概念验证并编写了一个函数,将我当前网页中的值和样式替换为JavaScript
例子;
const headerColor = document.getElementById("topheader");
headerColor.style.backgroundColor = 'white';
headerColor.style.background = 'none';
我想知道我是否可以将所有这些保存在一个 cookie 中,以便在整个结帐过程中创建具有这些样式的演示。
例如,我暂时将页面标题替换为JavaScript
并希望将其保留在 cookie 中以供会话的剩余部分使用。
这可能吗?
解决方案
推荐阅读
- spring - setPropertyActionListener 没有在 bean 中设置目标值
- php - 雄辩的顺序关系结果
- spring-boot - spring boot distributed transaction error java.lang.ClassNotFoundException: javax.transaction.TransactionManager
- opengl - 着色器中的条件语句是否成本更高?
- geometry - 将画布放在 Div 元素内
- fabricjs - 如何在fabric js文本框中更改光标的y轴位置
- cluster-analysis - K-modes 集群演化
- r - 在所有方面写入 x 轴标签而不进行缩放
- java - 如何使用 jmeter 加载测试肥皂 api
- c - fscanf 从文本文件到结构指针