2010-04-26 51 views
0

我寫了一個jQuery的功能,現在我想使用它作爲一個插件,所以我可以使用超過1個place.the代碼lookes這樣的:寫jQuery插件

function loadTable(){ 
    $.post("includes/action.php", {action: "gettable"}, function(html){ 
     $("#tblstudents tbody").html(html); 
     $("#tblstudents") 
      .tablesorter({widthFixed: false, widgets: ['zebra'], sortList: [[0,0]]}) 
      .tablesorterPager({container: $("#pager")}) 
      .tablesorterFilter({filterContainer: $("#filter-box"), filterClearContainer: $("#filter-clear-button")}); 
    }); 
} 

而且我希望它具備的功能在$ .post函數和$(「#pager」),$(「#filter-box」)和$(「#filter-clear-button」)中設置「includes/action.php」和「gettable」 (「#tblstudents」)。任何人都可以幫助我嗎?

+0

http://docs.jquery.com/Plugins/Authoring – blockhead 2010-04-26 16:52:44

回答