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

The Archive Base Latest Questions

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

I am facing an issue where a link on my website opens in a

  • 0

I am facing an issue where a link on my website opens in a new window if you simply click on it. However, if you right click and say open in new window or new tab, it opens the same window (URL) again from where the link is clicked.

Self Service Option is a link and the JSP calls a function getSelfServSite() when the link is clicked. This is how the code flows in my case

function getSelfServSite()
{
   getToTheLink("${myConfigInfo.selfServiceURL}"); 
   // this is because the URL is configurable
}

function getToTheLink(url) 
{
   window.open (url, "currentWindow", "");
}

What am I doing wrong. I want it to go to the right link no matter how the user click it.

Please advise. 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-26T21:20:43+00:00Added an answer on May 26, 2026 at 9:20 pm

    I would suggest doing something like this.

    Setup an event handler to capture when a user right clicks. When they do, run you function to get the selfServSite url, and set the links href attribute to be the new Url.

    here is some info on capturing the right click event.

    How can I capture the right-click event in JavaScript?

    EDIT: Based on our discussion in the comments, here is a revised solution.

    When the page is opened in a new window from a right-click, it has “#id-card” appended to it, so what you need to do is check for that value when the page first loads, and if it’s there, run the same javascript function that gets run when the user left-clicks on the link.

    You can check for this value using the location objects hash property.
    http://www.w3schools.com/jsref/obj_location.asp

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

Sidebar

Related Questions

I am facing one issue because of URL encoding in window.open function when used
I am new to MVC and facing one issue. I have a xml file
I'm facing a strange issue, I'm trying to localize a website, so i converted
I am facing issue of the WCF Services on staging server. The same service
I am facing an issue while executing queries.I use the same resultSet and statement
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
I am using Appweb server (mini http server) and facing an issue while opening
I'm working on a project which uses user authentication. I'm facing a issue with
i am doing a database design using EAV. I am facing an issue when
I am using ASP.NET MVC2 with NHibernate, but am facing an issue. All calls

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.