鼠标悬停不起作用
我试图让 onmouseover 和 onmouseout 在一些相当简单的 PHP 代码中工作。虽然生成的网页源代码很好地显示了 HTML 标记,但对于 onmouseover 和 onmouseout 属性,锚点继续显示(在窗口状态栏或 Chrome 中的等效项等)我尝试屏蔽的原始目标。
如果我在桌面上使用简单的 html 进行测试,则 onmouseover 和 onmouseout 工作正常;它们只是不适用于网络上提供的页面。对我做错了什么有什么想法吗?或者我可以使用其他替代方案吗?我只是不希望人们看到“http://www.anrdoezrs.net/click-5510191-10819825”的联属营销域名,而该链接实际上/最终会转到 Groupon,或者其他什么情况。希望有一个简单的语法修复或替代方法来实现这一点。谢谢。
(这些目标变量位于一个数组中;从数组中随机选择一个变量传递给 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>"
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>"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Chrome(和大多数其他浏览器)不允许网站更改您的状态栏,因为您正试图在此处进行滥用。显示在浏览器左下角的 URL 的全部目的是向用户提供有关链接要去哪里的信息。
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.