Jquery ui错误“undefined不是函数”

时间:2022-12-06 15:35:17

I am using jquery ui. and the code is hosted in Here

我正在使用jquery ui。并且代码托管在Here

On opening the console one can see the error "undefined is not a function".

在打开控制台时,可以看到错误“未定义不是函数”。

I am unable to find the reason for the same. We tried the same code in local machine(that is localhost), without any other theme, and it worked fine.

我无法找到相同的原因。我们在本地机器(即localhost)中尝试了相同的代码,没有任何其他主题,并且它工作正常。

The below js we have included

以下js我们已经包括在内

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>

I am using ghost blogging platform built on node js. The theme being used is casper. Will be thankful for any kind of help or pointer to this problem that I am facing.

我正在使用基于节点js构建的ghost博客平台。正在使用的主题是casper。将感谢任何形式的帮助或指向我面临的这个问题。

Thanks Again,

再次感谢,

Mebin

Mebin

3 个解决方案

#1


2  

@Regent, pointed out the problem in the comments, src="/public/jquery.js?v=b9f058cf2f"> in the footer was causing the problem.

@Regent,在评论中指出问题,src =“/ public / jquery.js?v = b9f058cf2f”>在页脚中导致了问题。

#2


1  

I think in your Page which is having the below code. But there is no Jquery library get imported.

我认为在您的页面中有以下代码。但是没有导入Jquery库。

<script>
  $(function() {
    $ ( "#tabs" ).tabs();
  });
</script>

These links are broken: Actually its not importing the Scripts

这些链接被破坏了:实际上它没有导入脚本

<script src="http://www.ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
 <link rel="stylesheet" href="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>  

Click to check your likn of jquery.min.js

点击查看你的jquery.min.js的likn

Click to to check your likn of jquery-ui.css

点击查看你的jquery-ui.css的likn

Click to to check your likn of jquery-ui.min.js

点击查看你的jquery-ui.min.js的likn

Jquery ui错误“undefined不是函数”

Modify your src cdn web links like below: Remove http://www. and Put ``

修改你的src cdn web链接,如下所示:删除http:// www。并把``

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script> 

#3


-1  

You have a function in your <script>

你的

$(function() {
$ ( "#tabs" ).tabs(); //console shows you have error on this line
});

Try putting it inside document.ready()

试着把它放在document.ready()中

$(document).ready(function(){
$ ( "#tabs" ).tabs();
});

Also your code is outside <head> tag. Try placing it inside <head> tag.

您的代码也在标记之外。尝试将其放在标签内。

#1


2  

@Regent, pointed out the problem in the comments, src="/public/jquery.js?v=b9f058cf2f"> in the footer was causing the problem.

@Regent,在评论中指出问题,src =“/ public / jquery.js?v = b9f058cf2f”>在页脚中导致了问题。

#2


1  

I think in your Page which is having the below code. But there is no Jquery library get imported.

我认为在您的页面中有以下代码。但是没有导入Jquery库。

<script>
  $(function() {
    $ ( "#tabs" ).tabs();
  });
</script>

These links are broken: Actually its not importing the Scripts

这些链接被破坏了:实际上它没有导入脚本

<script src="http://www.ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
 <link rel="stylesheet" href="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="http://www.ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>  

Click to check your likn of jquery.min.js

点击查看你的jquery.min.js的likn

Click to to check your likn of jquery-ui.css

点击查看你的jquery-ui.css的likn

Click to to check your likn of jquery-ui.min.js

点击查看你的jquery-ui.min.js的likn

Jquery ui错误“undefined不是函数”

Modify your src cdn web links like below: Remove http://www. and Put ``

修改你的src cdn web链接,如下所示:删除http:// www。并把``

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script> 

#3


-1  

You have a function in your <script>

你的

$(function() {
$ ( "#tabs" ).tabs(); //console shows you have error on this line
});

Try putting it inside document.ready()

试着把它放在document.ready()中

$(document).ready(function(){
$ ( "#tabs" ).tabs();
});

Also your code is outside <head> tag. Try placing it inside <head> tag.

您的代码也在标记之外。尝试将其放在标签内。