以下代码在Firefox中正常工作,但在IE中不起作用。我已经尝试了对头文件和脚本调用字符串的各种调整,但是没有任何东西会使IE运行脚本。 IE中也关闭所有安全性。Internet Explorer 8中的JQuery问题
下面的代码有什么问题吗?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Smartube</title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script src="jquery.js" type="text/javascript"></script>
<script src="tubeutil.js" type="text/javascript"></script>
<script src="init.js" type="text/javascript"></script>
<script type="text/javascript">
function formfocus() {
document.getElementById('1').focus();
}
window.onload = formfocus;
</script>
</head>
<body>
<div class="wrapper">
<img class="displayed" src="gfx/sb.png">
<form class="blocks" action="" method="get">
<p><input type="text" class="search" id="1" /></p>
<p><input type="Submit" class="btn" value="" /></p>
<ul class="reset autocomplete"></ul>
</form>
<ul class="reset videos"></ul>
</div>
</body>
</html>
+1。另外,在jQuery中,你不需要整个窗口的'load'事件,你可以开始在文档ready事件中操作DOM。 :) – Shef
非常真实的,我想我会写这个作为他的代码严格的jQuery翻译,但是,我通常只会使用'$(function(){'... – n00dle
无效,但谢谢 –