« first day (1837 days earlier)      last day (3122 days later) » 
00:00 - 23:0023:00 - 00:00

11:35 PM
I am most confused...
^ The textarea should revert back to nothing with the placeholder text, but instead the cursor is on the second line.
if (event.keyCode == 13){
        setupSocket();

        $("#messageBox").val("");

        var e = jQuery.Event("keyup");
        e.ctrlKey = false;
        e.which = 8;

        $("#messageBox").trigger(e);
    }
^ the code that is applicable
Having the jQuery event should send a backspace, which should delete the newline in the textbox :P
 
Let me take a peek.
First of all, using var inside an if() block really isn't a good idea. It's valid but scope in JavaScript is function-wide so it exists outside the if() block.
...which can lead to all manner of confusion. And most JS lint tools will flag it.
 
Ah. Well, if I can just clear the textarea entirely in a simpler form that would be amazing
 
What is key #8, BTW? I can't remember off the top of my head.
 
It should be backspace
 
Another thing to remember - events propagate, so unless you stop propagation, the "enter" will cause your event handler to be run but still add a newline since that's the default thing to do when the key is pushed.
You might want to paste a little bit more of your code so we can see how the event handler for key presses is registered.
 
11:41 PM
You can see it all here
 
I figured that since the code that handles the clearing occurs within the if keycode block, it wouldn't add the newline to the textarea
 
Aha.
The fix is super easy.
messageBox.addEventListener("keypress", function(){
    if (event.keyCode == 13){
        setupSocket();
        $("#messageBox").val("");
        event.preventDefault();
    }
});
 
Yup :)
Just figured that out >.>
 
Well, anywho - it works now \o/
 
11:47 PM
Yeah :)
You can see what I've been working on at rpiawesomeness.ddns.net:8080
It's for a top-secret project, but that part you can see :D
It's a Python websockets server, with a Javascript webpage that interacts with it
 
Cool. That sounds like fun.
 
Yeah
RN I'm trying to figure out how to send messages to everyone currently connected
 
00:00 - 23:0023:00 - 00:00

« first day (1837 days earlier)      last day (3122 days later) »