错误:“未定义jQuery" [英] Error: 'jQuery is not defined'

查看:135
本文介绍了错误:“未定义jQuery"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经用jQuery编写了一个脚本. 它适用于Firefox和GoogleChrome. 仅使用IE,我会返回此错误:

I have written a script with jQuery. It works with Firefox and GoogleChrome. Only with IE I have this error returned:

未定义'jQuery'jquery-ui-1.8.4.custom.min.js,第10行字符1

'jQuery' is not defined jquery-ui-1.8.4.custom.min.js, Row 10 Character 1

这是我页面的标题:

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Contattaci - TheItalianBrand.com</title>
    <script type="text/javascript" src="lib/jquery.js"></script>
    <script type="text/javascript" src="lib/js/jquery-ui-1.8.4.custom.min.js"></script>
    <link type="text/css" href="lib/css/smoothness/jquery-ui-1.8.4.custom.css" rel="stylesheet" /> 
    <script type="application/javascript">
       $(function(){



    $('#dialog_link, ul#icons li').hover(
     function() { $(this).addClass('ui-state-hover'); }, 
     function() { $(this).removeClass('ui-state-hover'); }
    );

    $('input').change(function() {
      validate();
    });
    $('input').keydown(function() {
      validate();
    });
    $('textarea').change(function() {
      validate();
    });
    $('textarea').keydown(function() {
      validate();
    });
   });
   </script>
   </head>

我该怎么办?

推荐答案

  1. 不使用application/javascript,更改为text/javascript

检查jquery的路径
您的jQuery是在lib/js/中,还是在lib/中?

Check the path of jquery
is your jquery in lib/js/, or just lib/?

确保您的lib目录相对于调用页面
您可能是说/lib/jquery.js(开头的斜杠有所不同)

Make sure your lib directory is relative to the calling page
You may have meant /lib/jquery.js (the slash in the beginning makes a difference)

这篇关于错误:“未定义jQuery"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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