I am trying to open a link in new window, however the link may contain an additional QueryString which is unfortunately available when the user clicks the link. So even the link is given in the code like:
<a href="somepage.aspx">click</a>
when the user clicks I want user to go to
<a href="somepage.aspx?id=1">click</a>
and the “1” value on the above example is calculated when user clicks the link. I am aware I can accomplish this with
<script>
function openlink()
{
var calc_i;
// do calculations and update calc_i value
window.open("somepage.aspx?id="+calc_i);
}
</script>
<a onclick="openlink()">click</a>
This results in a popup window (which I don’t want).
What is your suggestion?
Try the following:
You can specify the name of the new window, which should be opened in window.open. If you use
_blankit opens up in a complete new window.Working example