Is there a way to disable the 'X" close button of the browser ?

Is there a way to open a pop up window that does NOT have the X to close it ?
I want to force the user to close it with our custom button so that when they do the parent page is refreshed.
LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineNo oneCommented:
There's no guaranteed way to do it because this kind of javascript call was massively abused during the early years of the web and the browsers don't typically allow it anymore.  And the first time a site tries to do this to me is the last time I visit this site (assuming this is a public page)

You'd be better off opening a modal div/iframe and have your refresh action fire from that.  Similar effect, more control, less chance of running into sandbox/security issues.
0
AleksAuthor Commented:
That's ok. I don't mind if the user closes the window using the browser "X".
BUT when they do I need to refresh the parent page. How can I do this ?
0
Jason C. LevineNo oneCommented:
It would look something like this:

<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>

Open in new window

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

AleksAuthor Commented:
Where should I place that code ?  in the pop up window ?
0
Jason C. LevineNo oneCommented:
Yes
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AleksAuthor Commented:
I can't modify that window unfortunately. We are going to try a different approach, thanks to all.
0
AleksAuthor Commented:
Thank.s
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.