$(document).ready()如何在IE 8中运行? [英] How does $(document).ready() work in IE 8?

查看:123
本文介绍了$(document).ready()如何在IE 8中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了IE 8,似乎无法获取jquery $(document).ready事件。我有什么特别的考虑因素吗?通俗易懂,这就是我在html中的所有内容,它在Chrome和Firefox中按预期工作:

I've recently installed IE 8 and can't seem to get the jquery $(document).ready event to fire. Are there any special considerations that I'm missing? Litterally, this is all I have in my html and it works as expected in Chrome and Firefox:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Page full of awesomeness</title>
    <script type="text/javascript" src="~/Scripts/jquery-1.3.2.js" />
    <script type="text/javascript">        
        $(document).ready(function() {
            alert("Hello?");           
        });
    </script>
</head>

<body>

</body>

在Internet Explorer中,页面只是加载没有事件。没有警报框,我看不到任何报告的javascript错误。这是我不知道的正常事情吗?

In Internet Explorer, the page just loads without incident. There's no alert box and I can't see any javascript errors reported. Is this something normal that I just don't know about?

推荐答案

试试这个。

<script type="text/javascript" src="~/Scripts/jquery-1.3.2.js" />

进入此

<script type="text/javascript" src="~/Scripts/jquery-1.3.2.js"></script>

这篇关于$(document).ready()如何在IE 8中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆