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

  • SEARCH
  • Home
  • 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 8271995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:59:35+00:00 2026-06-08T06:59:35+00:00

Trying to get a centered popup to display after a set value of time,

  • 0

Trying to get a centered popup to display after a set value of time, something like this:

<script type="text/javascript">
    <!--
    function popup(url) {
    var width = 300;
    var height = 200;
    var left = (screen.width - width) / 2;
    var top = (screen.height - height) / 2;
    var params = 'width=' + width + ', height=' + height;
    params += ', top=' + top + ', left=' + left;
    params += ', directories=no';
    params += ', location=no';
    params += ', menubar=no';
    params += ', resizable=no';
    params += ', scrollbars=no';
    params += ', status=no';
    params += ', toolbar=no';
    newwin = window.open(url, 'windowname5', params);
    if (window.focus) {
        newwin.focus()
    }
    setTimeout(popup('`test/login.html'), 5000);
    return false;
}

//-->
//]]>
</script>

but the popup never displays. If I write it like this:

    <script type="text/javascript">
        <!--
        function popup(url) {
            var width = 300;
            var height = 200;
            var left = (screen.width - width) / 2;
            var top = (screen.height - height) / 2;
            var params = 'width=' + width + ', height=' + height;
            params += ', top=' + top + ', left=' + left;
            params += ', directories=no';
            params += ', location=no';
            params += ', menubar=no';
            params += ', resizable=no';
            params += ', scrollbars=no';
            params += ', status=no';
            params += ', toolbar=no';
            newwin = window.open(url, 'windowname5', params);
            if (window.focus) {
                newwin.focus()
            }

            return false;

        }
        setTimeout(popup('`test/login.html'), 5000);
        //-->
        //]]>
    </script>

the popup displays immediately, but then I receve an Invalid Argument error. Suggestions?

  • 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-08T06:59:37+00:00Added an answer on June 8, 2026 at 6:59 am

    setTimout takes a function as its first parameter. popup(...) does not return a function. Try this:

    setTimeout(function() {popup('`test/login.html');}, 5000)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i am trying get 2 div-containers which both should contain centered text (Both
I am trying to get the cell detail text to be centered. I have
I've been trying to get a block of text centered horizontally and vertically within
Just trying to get into JQueryMobile. I want to do something simple like putting
I am trying to creat a layout like this: My question is specifically centered
Possible Duplicate: css vertical centering I'm trying to get text centered in a vertical
Trying to get a wildcard search to pick up on any text in org_name
trying to get same string on tooltip as is in the Text e.g. Text=<%#
Trying to get this expression to work, can someone look at it and tell
I'm trying to get a <asp:Label> to appear centered under a <asp:ImageButton> . Right

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.