0

This is the site: http://www.hfwebdesign.com/

I'm getting this error: Uncaught TypeError: Object [object Object] has no method 'flexslider'

But in my localhost it works perfectly.

This is the <head> (where the script is being called):

<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'template_url' ); ?>/js/flexslider/flexslider.css" />
<link rel="icon" type="image/png" href="<?php bloginfo( 'template_url' ); ?>/favicon.ico" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="<?php bloginfo( 'template_url' ); ?>/js/flexslider/jquery.flexslider-min.js"></script>
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>  

footer:

<script type="text/javascript">
  var $j = jQuery.noConflict();
  $j(document).ready(function() {
    $j('.flexslider').flexslider({
      animation: "slide"
    });
  });
</script>

</body>

Could it be that the code is breaking in the web server in the remote host and not in my localhost (e.g. they are different version of LAMP/APACHE?)

4
  • Your script tag for Flexslider looks like this in the page: <script src="http://www.hfwebdesign.com/wp-content/themes/twentytwelve/js/flexslider/jquery.flexslider-min.js.pagespeed.jm.noGKd8vLzs.js"></script> . Is that correct path? Commented Feb 13, 2013 at 11:05
  • @Teemu I think WordPress is adding the .pagespeed.jm.noGKd8vLzs. part. Some cache speeding thing that I don't know how to deactivate. Commented Feb 13, 2013 at 11:06
  • check the file jquery.flexslider-min.js on server. I think it is got manified and your function is not calling. I faced same issue while uploading files from local to server. Commented Feb 13, 2013 at 11:06
  • @Yogesh Suthar The file is the server is still called jquery.flexslider-min.js I compared it with the one on my local host and seem the same. Commented Feb 13, 2013 at 11:11

2 Answers 2

1

Try chage the call place from:

<script src="http://www.hfwebdesign.com/wp-content/themes/twentytwelve/js/flexslider/jquery.flexslider-min.js.pagespeed.jm.noGKd8vLzs.js"></script>
<script type='text/javascript' src='http://www.hfwebdesign.com/wp-includes/js/jquery/jquery.js,qver=1.8.3.pagespeed.jm.1SksPi3j41.js'></script>

To:

<script type='text/javascript' src='http://www.hfwebdesign.com/wp-includes/js/jquery/jquery.js,qver=1.8.3.pagespeed.jm.1SksPi3j41.js'></script>
<script src="http://www.hfwebdesign.com/wp-content/themes/twentytwelve/js/flexslider/jquery.flexslider-min.js.pagespeed.jm.noGKd8vLzs.js"></script>

Don't sure about it, but try isn't bad.

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

3 Comments

No, it's like the first. Try change the call places and let flexslider to last js call...
Check if you doesn't calling 2 times jquery's script.
Thanks, it was being called twice. Now, I have to solve an annoying pagespeed issue in the CSS> Thanks!
0

Check case in your script path. If the script folder name is e.g. 'flexSlider' and in the script src path is 'flexslider', it will work on windows (most localhosts) but not on linux (most servers). It depends on the OS, not on the server SW, so running e.g. XAMPP on windows will work because windows works in case-insensitive way with paths.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.