Consider the following Html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test</title>
<style type="text/css">
</style>
</head>
<body>
<script type="text/javascript">
alert('' +
'\'test\'[0] = \'' + 'test'[0] + '\'\n' +
'\'test\'.charAt(0) = \'' + 'test'.charAt(0) + '\'\n'
);
</script>
</body>
</html>
When I open this file on my local machine it gives the following output (both in ie8 and Chrome):
'test'[0] = 't'
'test'.charAt(0) = 't'
When I host this file on IIS7.5 I still get the same result in Chrome but ie8 gives the following result:
'test'[0] = 'undefined'
'test'.charAt(0) = 't'
How is this possible?