Skip navigation
gregorylafrance
Currently Being Moderated

\n in result handler xml

Sep 6, 2013 1:34 PM

Tags: #textarea

When I extract the following from result handler xml, the \n display as \n in TextArea. How can I extract from result so they are actually line breaks?

 

<EmailText>Thank you for reporting this to us.\nPlease include the city you are in.</EmailText>

 

private function onGotResult(event:RestServiceResponse):void {

    var defaultEmailTextValue:String = resultData..EmailText;

}

 
Replies
  • Currently Being Moderated
    Sep 9, 2013 6:51 AM   in reply to gregorylafrance

    If you're actually seeing the character sequence "\n" it means somewhere along the lines a newline is being replaced by that character sequence... if you don't know where that's happening (I suspect somewhere on the server, not the Flex framwork) then your simplest solution would be to replace that character sequence with a newline:

     

    defaultEmailTextValue = defaultEmailTextValue.replace(/\\n/g, "\n");

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points