2010-04-26 3 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

답변

3

이 링크를 확인해야합니다 : http://docs.jquery.com/Plugins/Authoring

또는 여기에 단계 튜토리얼에 의해 단계 찾을 수 있습니다 http://www.queness.com/post/112/a-really-simple-jquery-plugin-tutorial 당신이 당신의 플러그인에 대한 자신의 옵션을 정의 할 수있는 방법에 대해 설명합니다.

+0

+1하지만이 자습서도 포함합니다.) http://www.learningjquery.com/2007/10/a-plugin-development -무늬 – Mottie