bug fix #4298: added javascript allow just one character if first character is not escape character else allow two including escape character

Signed-off-by: Smita Kumari <kumarismita62@gmail.com>