Click to See Complete Forum and Search --> : document.write issue


mackyda
06-26-2007, 10:00 PM
In the following code:

<script language="javascript">
document.write(unescape('%3C%3C%63'));
</script>

Why is only '<' outputted and not '<<c' ?

felgall
06-27-2007, 01:06 AM
Because < indicates the start of an HTML tag. Where there are two of them some browsers (but not all) will display one of them because they realise that the code is invalid and that you probably meant for at least one to be a &lt; instead.