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 我找到了方法:
javascript:void(this.onclick=function(){return false;})
Can you add attribute
onclick="return false;"
?
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;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.