0
How is "\n" supposed to look?
I tried "\n" and "\t" and I didn't notice a single difference other than the favt that it didn't have apostophies
3 Réponses
+ 4
"\t" is tab ya know
but with "document.write" doesnt show result as well
You should use at "alert" function
+ 3
They move the cursor; the next place something text-related is going to happen (keypresses, printing, scrolling).
Try putting \n and \t inside text (not just by themselves) and see what happens.
+ 2
Outputing JS is done in Html, so all spaces characters ( including tabs and new lines ) are handled as only one space when several nexted... This is the default behaviour of Html formatting. If you want to keep spaces and new lines as is, you must play with the css 'white-space' property ( or use the <pre> 'pre-formatted' tag which have already the default behaviour to keep spaces and new lines )
Anyway, on an alert() output, we don't be in Html format, so the default behaviour is to print all spaces and new lines ^^