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 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 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
Archived
This topic is now archived and is closed to further replies.