Function d(a) displays an alert with the ASCII value of each character from string a. One of the characters is ASCII 0, that I have displayed it on this post with [NULL].
This is the output I receive on different browsers:
GOOGLE CHROME – CORRECT
– String length: 3
– Alert outputs: 116, 0, 114
INTERNET EXPLORER 9 – INCORRECT
– String length: 2
– Alert outputs: 116, 114
What can I do to have these characters displayed in Internet Explorer 9? THANKS
<script type="text/javascript" charset="x-user-defined">
function d(a)
{
a=(a+"").split("");
var l=a.length;
alert(l); // Displays string length
for(var z=0;z<l;z++)alert(a[z].charCodeAt(0));
};
d("t[NULL]r");
</script>
Don’t put non-printable characters directly into code – it most likely will not work. Instead, use the correct entity
\0.