![]() Topic awaiting preservation: Multine innerhtml (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Montreal, Canada |
![]() Is there a escape sequence for multiline statements (I'm want to put a couple of tables using document.getElementById(id.innerHTML but i dont want to do it all in the same line |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Well, you can do this: |
Bipolar (III) Inmate From: Montreal, Canada |
![]() Thanks |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() I think I'll take this opportunity to warn those of you who like to ignore semi-colons in your code. This is a rare possibility, but it can happen. Suppose you wrote this code: |
Bipolar (III) Inmate From: Berlin (almost) |
![]() I suppose if the browser ignores the line break it might try to multiply c with either true or false, or maybe with one of the function names. Do I win? |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() Right idea, but not exactly correct; you get partial credit =) |
Nervous Wreck (II) Inmate From: |
![]() You don't have paretheses around the conditional statement so the 1st statement gets included as part of the condition. |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
![]() I think you've basically got it. The problem is, since there are no semicolons, the interpreter (the browser running the javascript) is forced to put them in itself. The rules for automatic semicolon insertion are: |