Online Forum To Support Coders With Technical Assistance - Read Write Execute

Disable F5 on php page

Ankit Agrawal
Ankit Agrawal
Published on August 9, 2016 · 1 min read
function disable_f5(e)
{
  if ((e.which || e.keyCode) == 116)
  {
      e.preventDefault();
  }
}

$(document).ready(function(){
    $(document).bind("keydown", disable_f5);    
});


Was this article helpful?
Ankit Agrawal

Ankit Agrawal

Author & Senior Engineer at CodeExecute

Writing practical engineering guides, debugging real-world bottlenecks, and creating free tools for developer productivity.

← Previous Article Show confirm box before mailto function Next Article → Hide admin bar from frontend in wordpress