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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:20:10+00:00 2026-05-26T11:20:10+00:00

My browser (firefox) prevents any popup from loading, and loads links that open new

  • 0

My browser (firefox) prevents any popup from loading, and loads links that open new windows in the current tab, unless I explicitly say I want the link to load on a new tab or window, with the appropriate shortcuts (for example, middle click on the link, or left click with ctrl pressed causes the link to open on a new tab, and shift + left click on a new window).

I would like to create a javascript function f() that runs some code (meant to create the link address) when the link is pressed, and then loads the link that has been created, without removing the user experience described above.
Right now what I have is something like <a href="javascript:void(0)" onclick="f()"/>, but middle click doesn’t work (it instead loads the url javascript:void(0)) and neither do the other features described above.

Do you have any idea as how to solve my problem ?

Thanks.

  • 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-26T11:20:10+00:00Added an answer on May 26, 2026 at 11:20 am

    have you tried window.open(‘url’)?

    see: http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

    Also, as far as I know, you can’t control whether or not the browser opens in a new tab or new window. That is a browser setting that is different for every user.

    You might also try removing the onclick, and using <a href="javascript:f()"></a>

    EDIT

    There seems to be issues with using middle click with opening new tabs instead of executing the javascript: middle click (new tabs) and javascript links

    As that site says, you can instead create an id for the element and bind it through javascript.

    **Taken from that link:

    <a href="/non/ajax/display/page" id="thisLink">...</a>
    

    And then in your JS, hook the link via it’s ID to do the AJAX call.
    Remember that you need to stop the click event from bubbling up. Most
    frameworks have an event killer built in that you can call (just look
    at its Event class).

    Here’s the event handling and event-killer in jquery:

    $("#thisLink").click(function(ev, ob) {
        alert("thisLink was clicked");
        ev.stopPropagation();
    });
    

    Without jQuery, it might look like this:

    document.getElementById('thisLink').onclick = function(e)
    {
         //do someting
         e.stopPropagation();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Check out http://fube.ca in any browser but Firefox and you'll see that the cloud
how does browser (firefox/safari) detects that website you are visiting is infected? Do they
Please visit http://domenadesign.com/istra-bike.com with Firefox browser! After a few clicks on the links page
I would like to open a new tab (or window, depending on the user's
I wish to block ALL my content from any users using an ad-blocking browser
I have a problem with the Firefox browser. You can see it here .
I need to create/update/remove cookie for FireFox browser. This cookie is a client cookie,
How can I hide a div with javascript if the browser is firefox only?
I have a question about the behavior of a browser( especially Firefox ) tackling
I've just restarted my firefox web browser again because it started stuttering and slowing

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.