0

Writeln not generating new Lin?

Keith Black 11 years ago in iPad updated by Alexander Blach (Developer) 11 years ago 1

For some reason I am not getting a new line using document.writeln. 

"document.writeln" only creates line breaks in the source code. The browser translates line breaks to spaces if it is not within a <pre> tag. I guess that's the reason why you don't see the line breaks in the browser window. Try to use document.writeln to write contents inside a <pre> tag and you should see line breaks.


You need to add a <br/> tag if you want to see line breaks in the interpreted code.


Also have a look at the answers to these Stackoverflow questions:

http://stackoverflow.com/questions/10247207/why-writeln-not-producing-a-new-line

http://stackoverflow.com/questions/5795843/document-writeln-doesnt-write-to-a-new-line