I have developed a Greasemonkey script to run on my favorite listing site. It generates a button at the top of the page :) then once clicked I can call in the function I want.
The problem is, the script I wanna call is in jquery format, and I learned that though jquery and javascript are close to each other, it is not possible to call jquery via javascript, plus the idea that I can't use the jquery since it give numerous conflict to the site :(
Here is the greasemonkey script:
// ==UserScript==
// @name My Fancy New Userscript
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @grant none
// @include *
// ==/UserScript==
var input=document.createElement("input");
input.type="button";
input.value="GreaseMonkey Button";
input.onclick = showAlert;
document.body.insertBefore(input,document.body.firstChild);
function showAlert()
{
alert("Hello World");
}
And this is the jquery I want to run after clicking the button:
$("tr.project-description").filter(function() {
return !$("span.verfied-badge", this).length;
}).remove();
What it does is it removes the <tr>
elements without the wanted <span class="verfied-badge">
the question is related here: javascript on page load check if a span (under <tr>) with a specific class exist, if does not exist remove the entire <tr>
Hope somebody can help. Thanks!