2

I'm using this plugin to create a pagination. On page click I have my function but I don't want the page to add #page-1 to the URL. How can I prevent that?

preventDefault not working because I can't catch the event.

$('#pagination').pagination({
    items: items,
    displayedPages: 3,
    edges: 1,
    onPageClick: function(pageNumber) {
        // my function
    }
);
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
user2587454
  • 903
  • 1
  • 19
  • 44
  • I have seen the plugin.May I know why do you want to do this?It's by the feature of the plugin. –  Sep 29 '15 at 08:39
  • my site is a single page application. i don't want changes in my url. – user2587454 Sep 29 '15 at 08:45
  • ok then please check http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page –  Sep 29 '15 at 09:03

1 Answers1

1

it is so simple!

 onPageClick: function (page, event) {
    event.preventDefault() 
  // my function
 }
Navid
  • 609
  • 6
  • 6