我将问题从JSON加载到我的EJS模板中,并希望填充localStorage中的每个字段。以下内容保存每个下拉列表,文本和滑块元素的最后一个值:
select
我对所有text
代码重复此操作。问题是slider
值也会传递到text
和slider
- 反之亦然(即如果我输入select
和import * as Server from 'socket.io';
const io = Server();
io.listen(3000);
export const connections = new Map();
io.on('connection', function (c) {
connections.set(c, c);
c.once('disconnect', function () {
connections.delete(c);
});
});
的值,覆盖Sub Copy()
'Declaration for copying the entire column of J
Dim lastrow As Long, erow As Long
Dim sRange As Range
Dim sCrange As Range
Dim sSheet as Worksheet
Dim sCSheet as Worksheet
Dim i as Integer
Dim cell As Range
'End Declare
Set sSheet = Worksheets("YTP")
Set sCSheet = Worksheets("GROUP")
sSheet.Range("J10:J350").Copy
sCSheet.Activate
sCSheet.Range("J5").Select
ActiveSheet.Paste
Application.CutCopyMode = False
lastrow = 360
For i = 10 to lastrow
If sSheet.Range("J" & i).Value = "" then
sSheet.Rows(i).delete
i = i - 1
lastrow = lastrow - 1
End If
if i > lastrow then Exit For
Next i
sSheet.Activate
End Sub
值,除非它们留空。)
我的最终目标是保存每个表单字段'最近的值,以便在刷新页面时我的条目不会丢失。
答案 0 :(得分:2)
创建表示已保存值的单个 localStorage条目会更加优雅,而不是污染LS,每个字段包含许多条目。我会推荐这样的东西:
(hex/m)%16!=0
这样,您只在localStorage中创建一个条目,并且每个条目类型都非常不同。然后,为了得到这些值,只需反过来做同样的事情:
hex