|
As I say, Javascript interprets a backslash as a control character. Replace() does not work as \x is not two separate characters, but one control character. You must either ban user ids which start with u or x, or revise your server-side code to change the delimiter to something other than a backslash. Note that domain\john is rendered as domainjohn in Javascript as the backslash is ignored here.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
|