jqeury mobile pagecontainer change not working on swipe

jqeury mobile pagecontainer change not working on swipe

I am working with jqm 1.4.5.

I want pages to change when user to swipes left and right.
So I created this code:

  1. $(document ).on( "pageinit", ".my-page", function() {
  2.     $( document ).on( "swipeleft swiperight", ".my-page", function( e ) {
  3.         var prevLink = <some url>;
  4.         var nextLink = <some url>;
  5.         if ( e.type === "swipeleft"  ) {
  6.             $( ":mobile-pagecontainer" ).pagecontainer( "change", nextLink, { reloadPage: true});
  7.         } else if ( e.type === "swiperight" ) {
  8.             $( ":mobile-pagecontainer" ).pagecontainer( "change", prevLink, { reloadPage: true});
  9.         }
  10.     }
  11. }

I get this error on the console log:

  1. Uncaught TypeError: Cannot read property '0' of undefined

On line with this code:

  1. $( ":mobile-pagecontainer" ).pagecontainer( "change", nextLink, { reloadPage: true});