Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
77
rated 0 times [  83] [ 6]  / answers: 1 / hits: 15768  / 14 Years ago, fri, september 24, 2010, 12:00:00

What is the difference between document.write(‘hello worldn’); and document.writeln(‘hello world’);?



Edit



My question is what will be the difference of output.


More From » javascript

 Answers
4

Historically, writeln was intended to handle different newline conventions, of with n is only one.



There are different conventions for end-of-line. 'n' is the end-of-line marker on UNIX, 'r' on Mac (AFAIK not any more as it's now a UNIX) and 'rn' is DOS/Windows. Using writeln should automatically use the correct one on the desired platform in other languages, but I don't really know whether JavaScript's document.writeln automatically uses the correct one automagically.


[#95513] Wednesday, September 22, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brennanm

Total Points: 510
Total Questions: 103
Total Answers: 95

Location: Nicaragua
Member since Tue, Dec 8, 2020
4 Years ago
brennanm questions
Thu, Jan 9, 20, 00:00, 5 Years ago
Thu, Sep 26, 19, 00:00, 5 Years ago
Thu, Aug 29, 19, 00:00, 5 Years ago
;