-3

I'm trying to get onmouseover and onmouseout to work in some fairly simple PHP code. While the resulting webpage source code shows the HTML markup just fine, for the onmouseover and onmouseout attributes, the anchor continues to show (in the window status bar or equivalent in Chrome, etc.) the original target that I am trying mask.

If I test with a simple html on my desktop, then the onmouseover and onmouseout work fine; they just don't work on pages served on the web. Any ideas of what I am doing wrong? Or is there an alternative I can use? I just don't want people to see the affiliate marketing domain of 'http://www.anrdoezrs.net/click-5510191-10819825' when the link is actually/ultimately going to Groupon, or what not. Hoping there is an easy syntax fix or alternative way of accomplishing this. Thank You.

(These destination variables or in an array; a random one from the array gets chosen to be passed to the HTML.)

$images1[0] = "<a href = 'http://www.anrdoezrs.net/click-5510191-10819825' target='_blank' onmouseover=\"window.status='http://www.groupon.com?z=dealpage';return true;\" onmouseout=\"window.status=' ';return true;\"><img src='//www.tqlkg.com/image-5510191-10819825' width='468' alt='Groupon: Get the Best Deal in New York Today!' border='0' /></a>"

1 Answers1

3

Chrome (and most other browsers) doesn't allow websites to change your status bar, because of exactly the sort of abuse you're trying to do here. The entire point of the URL showing up in the bottom-left corner of the browser is to give the user information on where the link is going to go.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • 3
    Hiding an affiliate link from the user is, IMO, abusive behaviour. I should be able to trust that the URL I'm seeing in the Chrome status bar is the URL I'll be visiting. – ceejayoz Jan 14 '12 at 03:08
  • exactly, that's why if it said groupon.com in the status bar, and you arrived at Groupon.com, then it would be trustworthy, and that's what I was/am trying to accomplish. Commission Junction codes all of the target links with the random domain, and they encourage people to use onmouseover so it looks as though you are going to where you are actually going to. – user1002456 Jan 14 '12 at 03:12
  • 2
    You're not taking me to Groupon, you're taking me to Commission Junction. That information is relevant to me, the user. – ceejayoz Jan 14 '12 at 03:18
  • 1
    @user1002456 If I want to go to Groupon, I'll type `www.groupon.com` into the address bar. Hiding the initial link destination, despite the fact that it *ultimately* redirects to Groupon, is still link hiding. If you want your users to trust the link, perhaps find a way to include the text "*groupon.com*", as in `?redirect_to=groupon.com` somewhere in the link. – Dan Lugg Jan 14 '12 at 04:54