Monkuar Posted August 15, 2012 Share Posted August 15, 2012 My simple ajax chat script is working nice. It's not long polling, only a short poll of about 5-10 seconds. Nothing really "Good". But I am wanting to make a command where users can send messages to each other by using /w USERNAME hello How would I go about with javascript of extracting the "username" after the /w command? i would need to use some type of split I suppose? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/267147-how-to-catch-w-command/ Share on other sites More sharing options...
Monkuar Posted August 15, 2012 Author Share Posted August 15, 2012 this has been solved firstword = str.split(/\b/)[1]; lol i am getting so smarter Quote Link to comment https://forums.phpfreaks.com/topic/267147-how-to-catch-w-command/#findComment-1369743 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.