In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what is the difference between writeln and write in javascript. It is very detailed and has certain reference value. Friends who are interested must read it!
The difference between writeln and write in javascript: when the writeln () method outputs data in the browser, it adds a newline character to the end of the data, while the write () method does not add a newline character to the end of the data in the browser, so it cannot wrap.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
Javascript provides two ways to display data directly in a browser. You can use write () and writeln (), which are methods of the document object.
The writeln () method is almost the same as the write () method, except that Write cannot wrap, and Writeln can wrap.
Writeln () will add a newline character after any string provided. The write () method does not add a newline character to the end of the string.
Note: the line wrapping effect of writeln can not be seen in the web page, it is displayed by the browser as a space.
You can't see the effect in both the HTML file and the source file of JSP. Readers can add pre-formatted tags to the tags to view the effect.
[xss_clean] ("write"); [xss_clean] ln ("writln"); [xss_clean] ("write")
You can also use the open method to open a new window to view the test
With (window.open ()) {[xss_clean] ("write") [xss_clean] ln ("writeln") [xss_clean] ln ("write")}
Then you can see the effect by viewing the web page source file in the pop-up window.
The above is all the content of the article "what is the difference between writeln and write in javascript". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.