简体   繁体   中英

Why doesn't jQuery Tablesorter Plugin work on this Wordpress page?

I have a working example of the Wordpress/jQuery plugin on this test page: http://beerlyrics.com/jimmy-jones/

I hardcoded it into the header on this page and both the pagination and filter mechanisms work correctly.

I have converted this over to a new page and am now using wp_enqueue to call all my scripts as it is supposed to be done: http://farmball.com/boston/boston-red-sox/red-sox-roster/

Why wouldn't the pagination and filter mechanisms no longer work?

I have confirmed that it has nothing to do with a #baseball-table not defined error and an audiplayer error that comes up in Firebug. The #baseball-table error is occurs on both sites and I deactivated the plugin causing the audioplayer error and it made no difference to plugin performance.

Here is the code for js initialization:

  jQuery(document).ready(function($) {
        $("#baseball-table").tablesorter({ debug: false, sortList: [[0, 0]], widgets: ['zebra'] })
                    .tablesorterPager({ container: $("#pager"), positionFixed: false })
                    .tablesorterFilter({ filterContainer: $("#filter-box"),
                        filterClearContainer: $("#filter-clear-button"),
                        filterColumns: [0, 1, 2, 3, 4, 5, 6, 7, 8],
                        filterCaseSensitive: false
                    });  });

I hired a developer to fix this. Strange but the fix was that there was a missing ( at the beginning of one of the js files in FTP though cPanel showed it at the beginning of the file. I use cPanel and didn't know it was missing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM