Orientation change event implementation by jquery mobile in phone gap

cordova, jquery, jquery-mobile

Solution

$(window).bind('orientationchange', _orientationHandler);

then in the `_orientationHandler` function, have something like:

if(event.orientation){
      if(event.orientation == 'portrait'){
                  //do something
      }
      else if(event.orientation == 'landscape') {
                    //do something
      }
}

Problem

Could someone please let me know the right code for orientation change event by jquery mobile in phone gap? Where and how do I implement this orientationChange function?

Original source