javascript - inconsistent line ending behavior on firefox in windows -
we having real bizarre issue, when post, line endings \r\n
, when pull value using javascript, gets \n
. causing issues, because our system create doing normal form post, , update pulling values form build out ajax request. later, doing string comparison on given field, , seeing strange mix between \r
being there or not being there.
ie handles fine (always \r\n
), ff on windows submit \r\n
, , in javascript report \n
. freakin strange though on linux, both firefox , chrome post \r\n
, , doing document.getelementbyid('text-area-id').value
show \n
.
is dusty corner of http spec or that? browsers implement windows servers won't die? there way around it, sanitizing every field? expect both js , http posts behave same way, , use system default on whatever system happen on.
\r
apparently illegal character in dom, why won't see script. firefox converts platform linebreaks \n
when set textarea's value. on other hand, when submitting form thinks needs use http linebreak standard, apparently \r\n
. converts them before sending form.
Comments
Post a Comment