Reputation: 3260
I have this HTML line:
<a href="<%url%>" target="_blank">link</a>
Where <%url%
> is a token I have to replace with a value that produces the click to do absolutely nothing. Note the anchor is in an iframe with the top same domain.
Consider:
#
and javascript:void(0)
but since the target is _blank
they
change the top.location.href
to the iframe window.location.href
so the iframe is loaded as the top window Upvotes: 0
Views: 3603
Reputation: 3260
I found the way:
javascript:void(this.onclick=function(){return false;})
Upvotes: 1
Reputation: 498
If you can put any string into the token, then make it end the href, then also include an onclick that cancels the click. Try replacing the token with this:
#" onclick="return false;
Upvotes: 0