Internet Explorer 8中的jQuery问题 [英] jQuery issue in Internet Explorer 8

查看:102
本文介绍了Internet Explorer 8中的jQuery问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让我的jQuery函数在IE8上运行。我正在从Google的服务器加载库( http:// ajax。 googleapis.com/ajax/libs/jquery/1.3/jquery.min.js )。

I am trying to get my jQuery functions to work on IE8. I am loading the library from Google's servers (http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js).

$(function()永远不会调用{})。相反,我得到一个错误预期的对象。我打开开发人员并在控制台中运行 typeof $ ,它出现为 undefined

The $(function(){}) is never called. Instead, I get an error Object expected. I opened the developer and ran typeof $ in the console, and it came up as undefined.

我曾尝试去其他我知道使用jQuery(jquery.com)的网站,这些都有用,有什么我可能会在这里丢失吗?

I have tried going to other sites that I know use jQuery (jquery.com), and those all work, is there something I might be missing here?

推荐答案

在变量定义时,在变量之前写var。 IE8在没有var时死掉。

Write "var" before variables, when you define them. IE8 dies when there is no "var".

这篇关于Internet Explorer 8中的jQuery问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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