0

I'm want to disable the manual refresh but still allow it throw code only. the page is responsive so the mobile refresh(drag down) is also need to be disabled.

I've tried already to preventDefault with:

window.onbeforeunload
window.onunload

and jquery:

$(window).unload
Omar
  • 32,302
  • 9
  • 69
  • 112
Lior Shitrit
  • 101
  • 7
  • This question isn't related to jQuery Mobile framework. Please use only relevant tag(s) to your question. – Omar Feb 23 '16 at 14:49

1 Answers1

2

You cannot disable a refresh - you would enforce the user to stay on your page.

A common way (like jsfiddle and others) that is used when there's unsaved state, is to trigger a popup that asks the user if the page should really be left. This is useful if some input hasn't been saved - having just some content that is refreshed over time it may be more annoying for the users.

A possible solution is found here

Community
  • 1
  • 1
Daniel Nachtrub
  • 366
  • 1
  • 6