Spent too long coding and now I can't get the most simple script to work
Someone please point out why this script is not working. It started out as an AJAX script and I took line by line away until I was left with a function containing an alert and it still will not work in IE. So please someone put me out of my misery.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=u开发者_JAVA技巧tf-8">
<meta http-equiv="Lang" content="en">
<meta name="author" content="">
<meta http-equiv="Reply-to" content="@.com">
<meta name="generator" content="PhpED 5.6">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="creation-date" content="11/11/2008">
<meta name="revisit-after" content="15 days">
<title>Untitled</title>
<link rel="stylesheet" type="text/css" href="my.css">
<script type="application/javascript">
function showUser()
{
alert('blah');
}
</script>
</head>
<body>
<input type="button" onclick="showUser()" />
</body>
Try using
<script type="text/javascript">
Also, the </html>
is missing.
<script type="text/javascript">
instead of
<script type="application/javascript">
And you can use JSBin to play with you code. Nice service!
精彩评论