2

I am using jquery ui. and the code is hosted in 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.

The below js we have included

<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.

Thanks Again,

Mebin

10
  • have you try with http://www.ajax...? Commented Sep 3, 2014 at 10:16
  • @diEcho I have added www. to the code and it still does not work :(. The code hosted has the update that you have suggested. Commented Sep 3, 2014 at 10:23
  • 1
    @user3258644 you can safely remove www - it's not the issue. While second jQuery including <script src="/public/jquery.js?v=b9f058cf2f"></script> at footer can really be a problem. Commented Sep 3, 2014 at 10:25
  • 1
    @Regent - A <link> tag can occur only in the head element Commented Sep 3, 2014 at 10:32
  • 1
    @aldanux ok, but I still suppose it doesn't affect scripts. And OP has problems with scripts now. And yes: I agree that this stuff should be placed in <head>. Commented Sep 3, 2014 at 10:37

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

2 Comments

It's a good idea to move answer from comments to normal answer, yes. You can also marked it as correct one.
+1 Yes it is. As per Site standards After one or two days Mebin can accept his own answer. Until that he will not get an option to accept an answer.
1

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

<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

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

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

Click on the Highlighted link in the Console

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

<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> 

6 Comments

Links are actually correct. You can see it in my mentioned fiddle
Its not loading the Jquery libs. Go to page View Source and click on the src links in your browser. Thats why you are getting undefined error here $ ( "#tabs" ).tabs();
well... It looks like OP changed links on site some minutes ago, because originally links were correct (links were as mentioned in question)
Links at the site for example, this are again correct right now, but error persists. That's what I'm talking about.
Yes, it's one more way to write link for including jQuery. Nevertheless, original links mentioned in question are also valid. And about this question: problem was solved in question's comments.
|
-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(function(){
$ ( "#tabs" ).tabs();
});

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

1 Comment

$(function() {}) is equal to $(document).ready(function() {}), so answer is deadly incorrect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.