Make onClick locations use href

By JoeSimmons Last update Jun 30, 2009 — Installed 276 times.

Example where it's not working

in
Subscribe to Example where it's not working 5 posts, 3 voices



qwertgb1 User

http://hackademix.net/2009/01/31/all-that-click...
There's an example on that page.

[href="http://yahoo.com"]
is still overwritten by:
[onclick="location='http://evil.hackademix.net/images/stallowned.jpg';return false"]

 
JoeSimmons Script's Author

It's because that page used location= not window.location=
I fixed it.

 
qwertgb1 User

Thank you!

Hmm, your script actually works in the opposite way of what I expected. But this is fine too, it's perfect as long as the true link is displayed in the status bar. Perfect, much appreciated!

 
Ylts User
FirefoxWindows

Thanks but it doesnt work here i think. http://www.outcraft.com/world.php

<img onclick="window.location='/mobattack.php?id=581395&code=e4c8745&hash=e00f585e96d865'" alt="Attack!" src="images/atk_player_icon.jpg" style="cursor: pointer;" onmouseover="doTooltip(event,'Attack Fiery Tower Guard!');" onmouseout="hideTip();" align="right" border="0">

I only want this "link" turned to this or something like that:

<a href="/mobattack.php?id=581395&code=e4c8745&hash=e00f585e96d865'" alt="Attack!" src="images/atk_player_icon.jpg" style="cursor: pointer;" onmouseover="doTooltip(event,'Attack Fiery Tower Guard!');" onmouseout="hideTip();" align="right" border="0">

 
JoeSimmons Script's Author
FirefoxWindows
Ylts wrote:
Thanks but it doesnt work here i think.
Actually it does, but it's not supposed to work on image elements. I'll see if I can make a direct link and switch it to a link.
Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel