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 6122115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:51:41+00:00 2026-05-23T15:51:41+00:00

I have to open two link within a same tab using JavaScript and HTML:

  • 0

I have to open two link within a same tab using JavaScript and HTML:

<script type="text/javascript">
go(){
windows.open('http://www.yahoo.com');
}
</script>
a href="https://mail.google.com/mail/u/0/?logout&hl=en-GB"onclick = "go();">click me</a>   

What I want; when someone clicked on click me hyperlink then it should automatically runs sign out link of Gmail in background without any alert and redirect the automatically link which is in windows.open('http://yahoo.com');.

  • 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-05-23T15:51:41+00:00Added an answer on May 23, 2026 at 3:51 pm

    Algorithm would be:

    1. on click dynamically add a DOM element: 1×1 px image with its source set to GMail logout URL;
    2. wait a couple of seconds (timer);
    3. redirect to Yahoo.

    Ok, whole test page content would be:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>test</title>
            <script type="text/javascript">
                function go() {
                    var oImg=document.createElement("img");
                    oImg.setAttribute('src', 'https://mail.google.com/mail/u/0/?logout');
                    oImg.setAttribute('alt', 'na');
                    oImg.setAttribute('height', '1px');
                    oImg.setAttribute('width', '1px');
                    document.body.appendChild(oImg);
                    var t=setTimeout("goOn()",1500);
                }
                function goOn() {
                    window.location.assign("http://yahoo.com");
                }
            </script>
        </head>
        <body>
        <p><a href="#" onclick="go();return false;">superlink</a></p>
        </body>
    </html>
    

    Have tested it in FFox – works fine : )

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

Sidebar

Related Questions

Wondering how to open many new windows with Javascript. I have found plenty of
Using jQuery UI , I have a tabs plugin and within tab 1 gets
This is a strange problem. I have two html pop-up windows, just hidden divs
I have an odd need to open two separate instances of excel and having
I almost always have a Scala REPL session or two open, which makes it
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
I have used two GUIDs to open the folders My Computer and My Documents
I have an Open Source app and I have it working on Windows, Linux
I now have two asp.net pages. When I click on a link on page
I have a button/link. I want to open multiple divs on multiple clicks on

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.