鼠标悬停不起作用

发布于 2024-12-27 02:55:24 字数 828 浏览 5 评论 0原文

我试图让 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

未央 2025-01-03 02:55:24

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文