问题描述
我正在使用jQuery,JavaScript的,PHP在Ubuntu平台。在该页面中,我通过jQuery的发送一个Ajax请求的PHP文件,并得到响应文本。该方案是在Windows的(WAMP)平台和网上成功运行。但在Ubuntu我收到JavaScript错误。在code如下...
I am working with jquery, javascript, php in Ubuntu Platform. In the page i am sending an ajax request through jquery to php file and getting response text. This program was running successfully in windows-(wamp) platform and online.But in Ubuntu i am getting javascript error. The code follows...
url = "index.php";
$.get(url,{
'action': 'Loan',
},
function(responseText){
alert(responseText);
},
"html"
);
在Ubuntu的我得到这个错误,未捕获的ReferenceError:$没有定义。此错误显示为$不用彷徨线。在脚本标记我包括jQuery库文件了。我不知道这是为什么错误来了。请解决我的问题。在此先感谢。
In Ubuntu i am getting this error,"Uncaught ReferenceError: $ is not defined". This error was showing at $.get line. In the script tag i included jquery library file too. I dont know why this is error is coming. Please solve my issue. Thanks in Advance.
推荐答案
$没有定义
jQuery的手段jQuery库未加载。
$ is not defined
on JQuery means the JQuery library is not loaded.
它可以发生的原因有很多,例如,
It can happen due to many reasons such as,
- 在Windows路径是不是在Ubuntu的一样。
- 在windows文件名不区分大小写,但在Linux中的区分大小写。
我建议你使用JQuery来自谷歌。
I suggest you use JQuery from google.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
</script>
这篇关于在Ubuntu中未捕获的ReferenceError JavaScript错误:$没有定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!