[Flashjs] Serialization of newlines
Tony X
tonyx.ca at gmail.com
Tue Nov 1 22:24:41 EST 2005
I dont;s really understand javascript, that's the problem
On 11/1/05, Adam Morton <flash at adammorton.com> wrote:
>
> Using the current svn head, i get javascript errors when flash attempts to
> send
> a string containing newline characters. I believe that serializeString
> function
> in JavaScriptSerializer needs to include a couple additional escapes for
> newline
> characters:
>
> /* Serializes a String */
> public static function serializeString(s:String):String
> {
> // ddura: We need to escape \ and ' and newlines so that when the
> // string is added to the args array and eval'ed
> // on the JavaScript side, it doesn't break.
> s = stringReplace(s, "\\", "\\\\");
> s = stringReplace(s, "'", "\\'");
> s = stringReplace(s, "\n", "\\n");
> s = stringReplace(s, "\r", "\\r");
> return "'" + s + "'";
> }
>
>
>
>
> _______________________________________________
> Flashjs mailing list
> Flashjs at osflash.org
> http://osflash.org/mailman/listinfo/flashjs_osflash.org
>
--
-----------------------------------------------------
Tony•X
http://www.tony-home.com
Where there is a will, there is a way.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/flashjs_osflash.org/attachments/20051101/cff4a3d9/attachment.htm
More information about the Flashjs
mailing list