textarea中回车换行问题
以前一直用
str = str.replace(/\r\n/g, "\\r\\n");
在ie和firefox中都能通过
今天突然发现在firefox中没有被替换调
于是断点跟踪了下,发现firefox中只有\n,没有\r
感觉很奇怪
以下内容来自互联网
By hitting this key, the printing head or the cursor on your screen will return to the left hand margin.
Usually hitting a Carriage Return or the "Enter" key includes a line feed,
i.e.the paper will move up one line or the cursor will drop down one line.
"Usually" does not mean always.
So check. You can usually correct the problem of not having a line feed
with a carriage return by moving a dip switch on the printer,
changing one of the parameters of the telecommunications software
program (the part where it says something about auto linefeed) or
changing the computer's operating system (by doing a "Config" or the like).
In most microcomputers, a Carriage Return is equivalent
to a "Control M," or ASCII 13. A line feed is a "Control J".
http://en.wikipedia.org/wiki/Carriage_return
http://en.wikipedia.org/wiki/Newline
分享到:
相关推荐
主要介绍了php使用str_replace实现输入框回车替换br的方法,可实现使用n替换成br的方法,需要的朋友可以参考下
文本回车换行符批量替换工具 功能有批量替换回车换行符:换行符替换工具,自动排序工具 繁体自动转换简体,简体自动转换繁体,繁简体字自动转换,文本间隔替换,回车替换工具
移除 字符串中的空格,或者最后的空格,或者回车符,可操作性强,可以帮助你做文字的处理。
用回车键代替TAB。
批量替换Excel回车换行符工具;
回车换Tab 方便,实现tab功能,屏蔽回车提交
表单切换,用回车键替换Tab健。input的属性tab的值表示切换的顺序,这个值必须是连续的,并且不能重复。目前不支持IE
通过JS完成替换回车为逗号
2、直接替换法1:Excel回车替换Ctrl+H--->查找内容处输入--->按住Alt+小键盘1+小键盘0--->全部替换--->保存。3、直接替换制表符:Excel回车替换制表符--->复制包含制表符列--->粘贴到记事本--->...
回车 替换成 \r 换行 替换成 \n \ 替换成 \\ ” 替换成 \” Tab 替换成 \t “翻译新版本”时,既可以使用“字典文件”,也可以使用“对照文件”。而“对照文件”可以使用“偏移量方式”的“分割对照文件”功能得到...
// 加上g是全局替换,不加只替换第一个 是回车、是换行符 form1.t1.value=s; } [removed] </head> <body> <form name=”form1″> <textarea name=”t1″ style=”height: 74px”></...
3、直接替换制表符:Excel回车替换制表符--->复制包含制表符列--->粘贴到记事本--->替换制表符--->复制记事本内容粘贴回EXCEL列。 4、Excel替换完成后,按照4-6步骤重新转化Excel后上传替换。是编辑...
逗号替换成回车逗号
HA_4EmEditor Pro v7.00.4 汉化版 可以使用转义符替换回车的编辑器
把大量的文本文档制作成CHM文件,方便使用。用文本文档制作时,它不会自动换行,所以才把TXT文件转换成HTM文件。
批量替换或清除EXCEL回车换行符;清除空格。
wpf telerik tab替换为回车,用户回车时,进入下一个可编辑格,而不是下一行
您可能感兴趣的文章:php字符串替换函数substr_replace()用法实例php使用str_replace实现输入框回车替换br的方法str_replace只替换一次字符串的方法PHP的substr_replace将指定两位置之间的字符替换为*号php函数之子...
'\r'是回车,'\n'是换行,前者使光标到行首,后者使光标下移一格。通常用的Enter是两个加起来。