The error message had multiple lines. But the new line character I had inserted in the string was not recognized.
Eg.
To have a successful authentication, please ensure you have fulfilled the requisites.\nBecome a member by paying the membership amount.\nNot all services come free.
But the newline character was not at all recognized. Instead it alerted the string along with \n.
The reason being while the string reaches ajax from the controller, '\n' becomes '\\n'. The solution for this issue is this...
alert(msg.replace
Eg.
To have a successful authentication, please ensure you have fulfilled the requisites.\nBecome a member by paying the membership amount.\nNot all services come free.
But the newline character was not at all recognized. Instead it alerted the string along with \n.
The reason being while the string reaches ajax from the controller, '\n' becomes '\\n'. The solution for this issue is this...
alert(msg.replace
(/\\n/g,"\n"));
This would alert the message as intended.