IE9 and TEXTAREA newlines

元气小坏坏 提交于 2019-12-20 05:48:05

问题


We display a piece of signed XML in a TEXTAREA. The signing takes into account the whitespace, so it is critical that this is maintained.

The user then copies and pastes this into an application that validates the XML... we've not had a problem with this until now... IE9 is rending the text slightly differently.

When I copy it into a HEX editor, I can see that IE9 is rendering newlines as 0xA... put it into compatibility mode (or use IE6,7,8, Chrome, Firefox etc.) and it gets rendered as 0xD,0xA

I guess this won't effect most people, as it looks ok... but for us it is a royal PITA!!!

Anyone come across this, and better have a fix :)

Thanks!!!


回答1:


Not sure if this is really a fix (and I do wonder if this is a bug in IE9?)

Anyhow, I ended up putting IE9 into IE7 emulation mode for the page in question:

http://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx

  <!-- Mimic Internet Explorer 7 -->
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >

It works, but now, of course I don't have the IE9 features on this page.



来源:https://stackoverflow.com/questions/5598271/ie9-and-textarea-newlines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!