当您发布聊天消息时,聊天输入不会清除


Chat input wont clear when you post a chat message

当您在我的聊天中发布消息时,输入框不会在发送消息后清除消息。因此,您每次都必须删除最后一条消息。

我的PHP:

fw::script_line('
    $(function(){
        function loop()
        {           
            Chat.cache('.$room['id'].');
            Log.cache('.$room['id'].');         
            Update.cache('.$room['id'].');  
            setTimeout(loop, 1000);             
        }
        loop();
        $(".input[name=content]").focus();
        $("#sidebar").hide();
    });
');

我的网页:

<div class="box chat">
    <div id="chat"></div>
    <form action="Javascript: Chat.post($('input[name=''content'']').val());" method="get">
        <input type="text" class="input" name="content" placeholder="<?php echo lang('type_here'); ?>">
        <a class="a_button" onclick="Chat.post($('input[name=''content'']').val());"><!-- Send !--></a>
    </form>
</div>

你应该能够在jquery中将值设置为"。 $(".input").val("")

希望有帮助。