views:

242

answers:

1

I use the following jquery statements but i get error in this

function onGetDataSuccess(result) {
Iteratejsondata(result);
$(document).ready(function() {
    $("#pager").pager({ pagenumber: 1, pagecount: 5, buttonClickCallback: PageClick });
});

PageClick = function(pageclickednumber) {
    $("#pager").pager({ pagenumber: pageclickednumber, pagecount: 15, buttonClickCallback: PageClick });
    $("#ResultsDiv").html("Clicked Page " + pageclickednumber);
         }
    }         
}

Error:PageClick is not defined....

+2  A: 

I believe the way you create the PageClick function it could be parsed after the other code or the PageClick variable is not in scope.

Try this:

 $(document).ready(function() {
        var PageClick = function(pageclickednumber) {
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: 15, buttonClickCallback: PageClick });
            $("#ResultsDiv").html("Clicked Page " + pageclickednumber);
        }

        $("#pager").pager({ pagenumber: 1, pagecount: 5, buttonClickCallback: PageClick });
    });
SBUJOLD
ya that worked...
bala3569