On Wed, Apr 17, 2002 at 10:55:21AM +0200, Joachim Schmitz wrote:
When the javascript contains a "<" like here:
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i < changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src =
changeImages.arguments[i+1];
}
}
}
the indentation gets confused, is there anyway to avoid this ?
Ah, there's a bug involved. '<' followed by whitespace shouldn't
really be considered the start of an element. Does the new version
at <http://www.cs.helsinki.fi/u/jesnellm/software/files/xmlmode.sl>
work better?
If separating the '<' or '>' from the surrounding text is for some
reason impossible, you could use a CDATA segment:
<html>
<![CDATA[
function changeImages() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i < changeImages.arguments.length; i+=2) {
]]>
<foo>
bar
</foo>
</html>
--
Juho Snellman
"C:stä on kehitetty Massachusettsin teknillisessä korkeakoulussa kieli
nimeltä BCPL."