使用crossrider,可以在dom中获取链接对象并更改链接的标题。我正在创建一个插件,检测恶意网站,并在链接前添加恶意。
我也许可以通过解析字符串来做到这一点,但是如果DOM支持它,那么我的工作就会轻松很多。
发布于 2012-12-30 17:06:59
appAPI.ready(function ($) {
// Where <linkSel> is the selector for retrieving the link or links you require
$(<linkSel>).text(); // retrieves the text for the specified <linkSel> object
// OR the following to prefix the link's text with '[Malicious] '
$(<linkSel>).text('[Malicious] ' + $(<linkSel>).text());
});https://stackoverflow.com/questions/14087384
复制相似问题