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

show alert box before leaving webpage

Ankit Agrawal
Ankit Agrawal
Published on June 18, 2015 · 1 min read

you can do this easily by using java script function

<script>
$(window).bind(&#039;beforeunload&#039;, function(e){
     return &#039;You are leaving this now&#039;;
});
</script>
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 How to export mysql database from command in windows Next Article → How to remove outline from input tag