views:

41

answers:

4

I'm getting this error in IE8:

Page Error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5;. NET CLR 1.1.4322;. NET CLR 2.0.50727;. NET CLR 3.0.04506.30;. NET CLR 3.0.4506.2152;. NET CLR 3.5.30729;. NET4.0C)
Timestamp: Wed, 1 Sep 2010 11:15:04 UTC


Message: Object does not support this property or method
Row: 10
Character: 2
Code: 0
URI: http://widerdesign.com.tw/wp-content/themes/starkers/js/custom.js

custom.js:

$(document).ready(function () {
    //easy slider
    $('ul.sf-menu').superfish();
    //easy slider
    $("#slider").easySlider({
        auto: true,
        continuous: true
    });
    //fancybox
    $("a#showcase1").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase2").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase3").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase4").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase5").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase6").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase7").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase8").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });

    $("a#showcase9").attr('rel', 'gallery').fancybox({
        'scrolling' : 'no',
        'titleShow' : false
    });
});

head tags in header.php

<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php
    /*
     * Print the <title> tag based on what is being viewed.
     * We filter the output of wp_title() a bit -- see
     * twentyten_filter_wp_title() in functions.php.
     */
    wp_title( '|', true, 'right' );

    ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/slider.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_directory'); ?>/css/superfish.css" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />

<?php
    /* We add some JavaScript to pages with the comment form
     * to support sites with threaded comments (when in use).
     */
    if ( is_singular() && get_option( 'thread_comments' ) )
        wp_enqueue_script( 'comment-reply' );

    /* Always have wp_head() just before the closing </head>
     * tag of your theme, or you will break many plugins, which
     * generally use this hook to add elements to <head> such
     * as styles, scripts, and meta tags.
     */
    wp_head();
?>
</head>

included js files on footer:

</div><!-- #footer -->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/easySlider1.5.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/superfish.js"></script>
</body>
</html>

any suggestions?

The code is properly working on Chrome and Firefox (as expected)

A: 

It looks like you haven't included the jQuery file as well? It needs to appear on your page as an include above the line that includes your own file.

Paddy
@Paddy yes they are included they are properly working in other browsers
janoChen
A: 

Well, you need to make sure that .superfish(), .easySlider() and .fancybox() are available. All three methods are not natively included in jQuery.

jAndy
@Paddy yes porperly working in FF, Chrome
janoChen
+1  A: 

You are including jQuery twice, which will wipe out any plugins defined on it since it defines $ and $.fn (before document.ready fires). To fix it only use one version of jQuery (multiple versions in a page do not play nicely, they're not designed to).

I think your footer should look like this overall:

</div><!-- #footer -->
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/easySlider1.5.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script>
</body>
</html>
Nick Craver
+1  A: 

I would start by removing the extra references to superfish and jquery. IE may be handling those differently than the other browsers.

Here's what I think it should look like:

<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/easySlider1.5.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/custom.js"></script>
Chuck
Just noticed Nick beat me to this.
Chuck