ubik
03-01-2006, 10:51 PM
Hello I have noticed that when using innerHTML you cannot put line breaks in the code, I am wondering if there is anyway around this.. for example how could i get this to work?
function replace() {
box = document.getElementById('csscontainer');
box.innerHTML = '$textfile';
}
the $textfile is a php variable that has a document of text in it with many line breaks or you can look at it like this:
function replace() {
box = document.getElementById('csscontainer');
box.innerHTML = 'some text goes here
some text goes here some text goes here
some text goes here, some text some text
goes here some text goes heresome text goes here';
}
? would i have to edit each text file? or could i do this with the script? i know i could use something like indexOf to find spaces between words.. but is there something to find the line breaks of a string? or are line breaks within strings not allowed in javascript?
function replace() {
box = document.getElementById('csscontainer');
box.innerHTML = '$textfile';
}
the $textfile is a php variable that has a document of text in it with many line breaks or you can look at it like this:
function replace() {
box = document.getElementById('csscontainer');
box.innerHTML = 'some text goes here
some text goes here some text goes here
some text goes here, some text some text
goes here some text goes heresome text goes here';
}
? would i have to edit each text file? or could i do this with the script? i know i could use something like indexOf to find spaces between words.. but is there something to find the line breaks of a string? or are line breaks within strings not allowed in javascript?