JavaScript [errors that are easy to ignore]: When a line break occurs, the line feed is lost, and the javascript line feed is resumed.1. Introduction
In JavaScript, when defining a large string, especially when there is a line break, to look neat
Regular Expression. No. metacharacters (except for carriage return \ r and line feed \ n), regular expression line feed
Regular Expression. No. metacharacters:The dot (.) metacharacters can match any character except the carriage return (\ r) and
[D3.js advanced series-1.0] text line feed and d3.js line feed
Adding text in SVG uses text elements. However, this element cannot be automatically wrapped, and the excess content cannot be displayed. What should I do?
Preface to the advanced series
After the text box textarea inputs content in the HTML webpage, The linefeed n is not visible to the naked eye, and the HTML display cannot convert n to linefeed. Because the label tag for line feed in HTML is br, the content of textarea should be
If the javascript code is placed on the html page, you can see the line feed effect. However, if the script is dynamically generated in php, \ n is changed to the line feed effect in the source file, that is to say, \ n only applies to text files.In
Recently, I encountered a problem about whether data can be transferred to Textrea for Row-based storage. Here I summarize whether a data transfer to Textrea for Row-based storage, here is a summary:
Problem description:
For example, if you want
Use ie directly:
Word-break: Break-all;/* line feed allowed */
Word-wrap: Break-word;/* The content will wrap in the boundary */
/* Note that the default value is :*/
Word-wrap: normal/* allow the content to open the specified window boundary
JQuery replaces the line feed method in textarea, jquerytextarea
This example describes how jQuery replaces the line feed in textarea. Share it with you for your reference. The specific analysis is as follows:
When my colleague learned jQuery
Automatically wrap English characters and truncate strings using js scripts. This method is applicable to ie6, ie7, and firefox. If you cannot use CSS control to force wrap, you can try
The Code is as follows:
Continuous English characters in
ArticleDirectory
Javascript Introduction
How to Implement Javascript
Where to place Javascript
Javascript statements
Javascript Variables
Javascript Operators
Javascript branch statement
Javascript message box
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.