I have this small HTML document:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>HTML Test</title> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("script").each(function() { if($(this).attr("type") == "code") { alert($(this).text()); } }); }); </script> </head> <body> <script type="code"> var Text = "Text"; </script> </body> </html>
When run using Firefox the alert displays the text contents of the <script type="code">
tag. When run in IE8 it displays nothing.
Do you know why? I'm stumped.