windows.beforeunload event not working in iPhone Safari

  • Hello,
    I am developing a webapp for one of client that shows and alert before leaving the page. Web app is working fine every where but it is not showing alert on iPhone  safari. 
     i am using following code inside document.ready()

      $(window).bind('beforeunload', function(){
            //var href = $(this).attr('href');
        return "Please fill below form to stay updated about latest news and updates. Ignore this message if you have already subscribed.";

    I tried many tricks but it is not working. Please dont post stack over flow as i have tried and checked most of codes from stackoverflow and no one is working.  Response containing stackoverflow urls will be blocked and deleted.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, or you want to Ask a new Question, Please Login or Create a new Account by Clicking below

Login with Facebook

Popular Posts of the Week