如何摆脱愚蠢的“垫” RTML 函数生成的标签?
我很不幸负责维护一些旧的雅虎! 使用基于 RTML 的平台构建的商店。
最近我注意到一些 RTML 函数生成的 HTML 代码中到处都是“填充图像”(或者任何用于强制布局的 1x1 像素图像的常规名称)。 我并不反对使用这样的图像,但是......所有这些图像都提供了这样的 ALT 属性:
<img href="http://.../image1x1.gif" alt="pad">
出于对 RTML 原始作者的所有应有的尊重,但当他们想出这种“可访问性”时,他们一定是在吸烟增强”... :-(
不管怎样,这是我的问题:
有人知道用所有这些“pad”图像生成 HTML 的所有 RTML 函数的列表吗?
有没有办法摆脱所有这些 alt="pad" 属性,而无需重写大量 RTML 代码?
NB: 这可能听起来有点愤世嫉俗,但提高了可访问性?不是这里的主要目标。主要目标是停止向 Google 和其他智能搜索引擎公开那些愚蠢的 alt="pad" 属性,因此到目前为止,客户端脚本不会有帮助。我所知。
谢谢你!
PS 也许,你们中的大多数人都很幸运,从未听说过 RTML。 因为如果有人根据
commercial success
------------------
usability
比率为软件产品设立一个奖项,那么这个基于 RTML 的“平台”可能会赢得第一名。
PPS 显然是雅虎的某人! 终于听了,因为我在为我们商店生成的 RTML 中找不到那些愚蠢的“pad”标签。 尽管如此,针对我最初的问题提出的想法之一确实提供了一个非常实用的解决方案 - 不仅针对最初的问题,而且针对 RTML 平台的任何类似问题。 查看获胜答案 - 非常好。
I am unlucky to be in charge of maintaining some old Yahoo! Store built using their RTML-based platform.
Recently I've noticed that HTML code generated by some RTML functions is sprinkled all over with "padding images" (or whatever is the conventional name for those 1x1 pixel images used to enforce layout). I have nothing against using such images, but... all those images are supplied with an ALT attribute like this:
<img href="http://.../image1x1.gif" alt="pad">
With all due respect to the original authors of RTML, but they must have been smoking something when they came up with this "accessibility enhancement"... :-(
Anyway, here are my questions:
Does anybody know a list of all RTML functions that generate HTML with all these "pad" images?
Is there any way to get rid of all those alt="pad" attributes without rewriting a lot of RTML code?
NB: This may sound a little cynical, but improved accessibility is not the main goal here. The main goal is to stop exposing those moronic alt="pad" attributes to Google and other smart search engines. So client-side scripting is not going to help, as far as I know.
Thank you!
P.S. Probably, most of you are really lucky and never heard of RTML. Because if somebody would establish a prize for software products based on
commercial success
------------------
usability
ratio, this RTML-based "platform" would probably win the first place.
P.P.S. Apparently someone from Yahoo! finally listened, because I can no longer find those silly "pad" tags in the RTML generated for our store. Nevertheless, one of the ideas offered in response to my original question does provide a very practical solution - not just to the original problem but to any similar problem with RTML platform. See the winning answer - it's really good.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我看到的唯一方法是拥有自己的网站前端,它将从 RTML 站点过滤您想要的任何内容......
例如,您的 rtml 站点位于 http://rtmlusglysite.yahoo.com/store/XYZ01134 ,您可以在 http://www.example.com 托管一个简单的 PHP 前端这就像一个“过滤”HTTP Web 代理,因此 http://rtmlusglysite。 yahoo.com/store/XYZ01134/item1234.rtml 将通过 http://www 访问.example.com/item1234.html
这不是一个理想的解决方案,但它应该可以工作,并且您可以做一些更奇特的事情。
The only way I see is to have your own website front-end that will filter whatever you want from the RTML site....
for example, your rtml site is at http://rtmlusglysite.yahoo.com/store/XYZ01134 , you could host a simple PHP front-end at http:://www.example.com that would be acting like a "filtering" HTTP web proxy, so http://rtmlusglysite.yahoo.com/store/XYZ01134/item1234.rtml would be accessed by http://www.example.com/item1234.html
It's not an ideal solution, but it should work, and you could do some more fancy stuff.
其他海报的尝试不错,但有一个非常简单的 RTML 命令可以做到这一点。 。 。
上面的 RTML 将找到 alt="pad" 的所有实例,并将其替换为空。
Nice try from the other posters, but there is a very simple RTML command that will do it. . .
The above RTML will find all instances of alt="pad" and replace it with nothing.
嗯,你说得对,RTML 相对来说还比较少见:)
你有办法将自己的属性添加到这些图像标签中吗? 如果是这样,是否可以覆盖 alt 属性? 如果您指定 alt="",我认为这会覆盖雅虎的...否则请考虑在其中为盲人和拨号类型放置一个有用的 alt 标签。
Well you're right on RTML being relatively untraveled :)
Do you have a way to add your own attributes to these images tags? If so, would it be possible to override the alt attribute? If you specify alt="", I would think that would override Yahoo's... Otherwise consider putting a useful alt tag in there for the blind and dialup types.
这是我第一次听说这个平台,但这里有一个想法:如果您可以将 javascript 添加到页面,您可以编写一个函数,该函数将在页面加载后运行并删除所有 alt="pad" 属性从页面。
不幸的是,该解决方案仅适用于了解脚本的浏览器,因此 lynx 或其他一些基于文本的浏览器可能不支持它。
It's the first time I'm hearing about this platform, but here is an idea: if you can add javascript to the pages, you could write a function that will run after the page has loaded and remove all the alt="pad" attributes from the page.
Unfortunately this solutions works only with browsers that know about scripting, so lynx or some other text based browsers might not support it.
我分享了来自 yahoo 的官方 RTML 指南链接。 希望它会有所帮助。 谢谢!
可用的 RTML 书籍和资源列表
I have shared a link official RTML guide from yahoo. Hope it will help. Thanks!
List of available RTML books and resources