【发布时间】:2015-06-24 05:19:47
【问题描述】:
我安装了“Greasemonkey”来删除特定网站的部分 HTML 代码。
我找到了用于删除的“jQuery”代码
function removeByClass(className) {
$("."+className).remove();
}
我尝试将“ClassName”替换为“news_ticker”,但没有成功。
我没有太多关于java语言的信息
我要删除的 HTML 部分代码如下
<div class="news_ticker">
<div class="title"><a title="Title";</a></div>
<div class="ticker">
<div class="wrapper">
<div class="ticker_feeds">
<span class="aa_icon">"headline"</span>
<span class="aa_icon">"headline"</span>
<span class="aa_icon">"headline"</span>
<span class="aa_icon">"headline"</span>
<span class="aa_icon">"headline"</span>
</div>
</div>
<div class="controls"><a class="prev" title=""></a><a class="pause" title=""></a><a class="next" title=""></a></div>
</div>
</div>
<style>
.static_banner01 {
clear: both;
overflow: hidden;
padding-bottom: 10px;
position: relative;
}
.banners{
overflow: hidden;
width: 190px;
float: right;
}
.m15{
margin-left:14px;
}
.m18{
margin-left:20px;
}
.m10{
margin-left:10px;
}
.w155,
.w155 a{
width:155px !important;
}
.banners a{
width: 190px;
height: 80px;
}
.banners.last{
margin-left:0;
}
</style>
【问题讨论】:
-
感谢您的帮助。首先,我确实包括了我需要脚本工作的网站,如下所示。
// @include http://www.website.com/*并且我确实包含了“jQuery”作为打击,但我的代码根本不起作用。// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js无论如何,我在 Greasemonkey 中制作了新的用户脚本,并复制了保存的每个代码并对它们进行了测试。它们都不起作用,甚至我也尝试浏览子页面,但标题仍然存在。 @delgan @v-p
标签: javascript html greasemonkey userscripts