好吧,首先从代码开始
JavaScript:
function keyevent(e) // submit key
{
if (e.keyCode == 13) // 13 = enter key
{
$(this).val("");
}
}
$(document).ready(function () {
$('#send').click(function() {
$('.message').val("");
});
});
HTML:
<input type="text" name="message" class="message" onKeyDown="javascript:keyevent(event);" />
<button name="send" id="send" onclick="refresh();" />Send</button>
然后我的页面上还有一个 if (isset($_POST['send')) 。但是当我看到我发送的消息时,消息框是空的,因为消息的值不存在。
所以我的问题是,我如何“延迟”删除操作?我试过延迟()