The difference between Write and Writeln in JavaScript

阿神
Release: 2016-12-10 09:12:20
Original
1157 people have browsed it

Write cannot wrap, but Writeln can wrap.

How to check the line wrapping effect of Writeln

You cannot see the line wrapping effect of writeln on the web page. It is displayed as a space by the browser.

wKiom1hGI9PjhMAvAAAJwSkxZBM314.png-wh_600x-s_2253347697 (1).png

The effect cannot be seen in the HTML file and JSP source file. Readers can add pre-formatted tags to the tags to see the effect.

Copy after login

and then view the web page source file in the pop-up window to see the effect. After testing by the author, there is no view source file column in the pop-up window in chrome 56.0.2924.3. At this time, you can "check" and see the effect in the Element column. There is a view source file column in IE11 and Firefox50.0. column.

Note:document.writeln (like document.write) does not work in XHTML documents

write and writeln do not work in XHTML files. HTML is XHTML with relatively loose syntax, which explains why it does not appear in html Line break.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!