$未定义 [英] $ is not defined

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

问题描述

我正在建立的网站上存在数据表不在的问题 加载(在服务器上),但在本地主机(xamp)上工作正常. Firefox抛出错误,未定义$".

I'm having an issue on a site I'm building where the datatable is not loading (on server) but works fine on local host (xamp). Firefox throws an error, "$ is not defined."

我已经搜索了错误,我发现一个朋友的解决方案未包含jquery.js文件,或者您对该文件的引用指向了错误的位置.

I've googled the errors, and I found a friend's solution that jquery.js file has not been included or your reference to it is pointing to the wrong location.

但是我两次检查了文件路径&三次,这是正确的& jquery.js也在那里.

But I checked the file path twice & thrice and it is correct & the jquery.js is also there.

感谢您的帮助,

推荐答案

导入jquery.js之前,有可能使用$对象.

It is possible that the $ object is used before jquery.js is imported.

一个典型的原因是使用某种jQuery插件:

A typical cause of this would be using some kind of jQuery plugin:

如果您有这样的话:

<script src="jquery.someplugin.js">
<script src="jquery.js">

尝试将其更改为此:

<script src="jquery.js">
<script src="jquery.someplugin.js">

请确保:将Firefox与Firebug插件配合使用,并查看问题出在哪里.然后您可以确定.

To be sure: Use Firefox with Firebug plugin and look where exactly the problem occured. Then you can be sure.

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

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