[thelist] Javascript: Long lines of code

Ben Henick persist1 at io.com
Thu Feb 22 15:33:14 CST 2001


On Thu, 22 Feb 2001, Asif Suria wrote:

> Does anyone know how I can break a really long
> Javascript line into multiple lines. The code I want
> to break down into multiple lines is 
> 
> alert ("The chair of the committee should be an
> instructional faculty with a regular academic
> appointment, Assistant Professor or higher, from the
> department awarding the degree. He must hold a Ph.D or
> its equivalent doctoral research degree");

Where you want a break on the alert text, insert:

\n

e.g.

window.alert("This is\nalert text\nwith linebreaks.");

If you need to control the lengths of your lines of CODE you may have to
build separate strings and follow those up with a statement to concatenate
them, but as long as the result evaluates in a manner comparable to the
example above it should work as desired.


-- 
Ben Henick
Web Author At-Large
http://www.io.com/persist1/
persist1 at io.com

"Are you pondering what I'm pondering, Pinky?"
"I think so, Brain, but... (snort) no, no, it's too stupid."
"We will disguise ourselves as a cow."
"Oh!" (giggles) "That was it exactly!"





More information about the thelist mailing list