1

I have a table cell whose value contains a line break as shown below.

<td>Foo
Bar</td>

I am reading the cell content using td.childNodes[0].nodeValue and passing the value in an Ajax request. But IE8 reads the LF as space such that "Foo%20Bar" gets sent instead of "Foo%0ABar". However, in Chrome LF is preserved.

Is there an alternative way of reading the cell in IE so that LF is retained?

4

1 回答 1

0

我认为您应该检测浏览器是否为 IE,然后应用操作(可能将“%20”替换回“%0A”)。

于 2013-03-08T11:05:31.207 回答