find clausen <> writes:
This script works, but how can I write it better ?
Please define "better".
Without the comment tags ....
Easy, don't write them.
<script>
<!--
document.write('<SCRIPT SRC="../scripts/sp'+lang+'.js"></script>')
// -->
</script>
Try:
<script type="text/javascript">
document.write('<script src="../scripts/sp'+lang+'.js"><\/script>');
</script>
It remembers the type attribute (*required* by HTML 4), and omits the
comment tags, escapes the </ inside the script tag, as required by
HTML (and remembers the semicolon at the end).
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'