Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8890853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:35:50+00:00 2026-06-14T22:35:50+00:00

I use the following code to open a new window with window.open and if

  • 0

I use the following code to open a new window with window.open and if somebody manually closes the window it will call the pause() function.

    <script type="text/javascript">

        var win = window.open("link.html", "thePopUp", "");
            var pollTimer = window.setInterval(function() {
if (win.closed !== false) { // !== is required for compatibility with Opera
    window.clearInterval(pollTimer);
    pause();
}
}, 200);

    </script>

BUT for that pause() function to work the user will need to be allowing popups for the window to first open and then to manually close it.

I would like the pause() function to be called if the window was never open in the first place so even if they aren’t allowing popups.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:35:51+00:00Added an answer on June 14, 2026 at 10:35 pm

    Instead of a pop up window I would recommend using a javascript modal pop up instead.

    Here is a demo:

    • http://www.jacklmoore.com/demo/modal/modal2.html
    • http://www.jacklmoore.com/colorbox/example1/
      • Outside HTML (Ajax) would be the best example for you. Have a look at the source code to see how to call this if this is what you want.

    There are many options for this. Here are a couple jquery options:

    • http://www.jacklmoore.com/colorbox
    • http://jqueryui.com/dialog/#modal

    I hope this helps. Let me know if you need more of a hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a project i use the following code to open a window: window.open(href, 'mysite'
I use the following code... $mail = new PHPMailer(); $mail->IsSMTP(); // send via SMTP
I'm trying to open a connection with the following function: Public cn1 As New
Assuming a handle created with the following code: use IO::File; my $fh = IO::File->new;
I have a page, test.php, with the following code: <html> <body> <form> <script type=text/javascript>
I'm trying to open a mpg-File using emguCV. I use the following code: if
I use following code: Create a retry policy, when error, retry after 1 second,
I just use following code to add an image to my project, var paper
I use VS2010, C# to develop Silverlight 4 app, I use following code in
I have an array of objects, and i use following code to get in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.