【发布时间】:2023-03-10 14:54:01
【问题描述】:
我的 ajax 请求以我需要在隐藏输入字段“时间”上设置的 newtimestamp 变量进行响应。
我试过这个:
$("#time").value(data.newtimestamp);
但是这显示了这个错误:
Uncaught TypeError: undefined is not a function
html:
<input type="hidden" value="<?php echo "$timestamp"; ?>" name="time" id="time" />
【问题讨论】:
-
应该是
val(),而不是value()。由于拼写错误,投票结束。