Topic awaiting preservation: Multine innerhtml (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Montreal, Canada |
posted 10-04-2002 23:36
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 |
posted 10-04-2002 23:48
Well, you can do this: |
Bipolar (III) Inmate From: Montreal, Canada |
posted 10-05-2002 00:07
Thanks |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 10-05-2002 21:08
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) |
posted 10-05-2002 21:48
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 |
posted 10-05-2002 21:50
Right idea, but not exactly correct; you get partial credit =) |
Nervous Wreck (II) Inmate From: |
posted 10-07-2002 07:40
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 |
posted 10-07-2002 17:06
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: |