1

I'm doing this to listen for pause event in Cordova:

$(document).on('pause', function( e ) { ... });

and now I need to check whether the pause event is attached to $(document).

I have tried to do: $._data($(document), 'events') and $.data($(document), 'events') but they always return undefined.

Any solution?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Frank
  • 2,083
  • 8
  • 34
  • 52

2 Answers2

1

Try this:

document.addEventListener("pause", onPause, false);
document.addEventListener("resume", onResume, false);
Joerg
  • 3,102
  • 2
  • 24
  • 30
1

You should pass DOM object and not jquery object, work like this :

$._data(document, 'events')
$.data(document, 'events')

Or with jquery object like :

$(document).data("events");

Take a look at jQuery object and DOM element.

Hope this helps.

Community
  • 1
  • 1
Zakaria Acharki
  • 66,747
  • 15
  • 75
  • 101