change number

52 views
Skip to first unread message

dschwa...@gmail.com

unread,
Aug 23, 2017, 3:38:16 PM8/23/17
to greasemonkey-users
Hi,

New to scripting with greasemonkey.  I just want to be able to change one number on a web page when it opens to another number or name.  When I inspect element on page I get <span class="ledger--section-total js-total-balance-value">$267,699.51</span>  the number is a changing number but I want to make it just a constant number.  Is there a way to script this to happen

Thank you

Klaus Johannes Rusch

unread,
Aug 24, 2017, 5:06:25 AM8/24/17
to greasemon...@googlegroups.com
// ==UserScript==
// @name          jQuery Example
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant  unsafeWindow
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
jQuery("span.ledger--section-total.js-total-balance-value").text("12345");

See https://wiki.greasespot.net/Third-Party_Libraries for using jQuery
with Greasemoney
See jQuery documentation how to access and modify the DOM tree

--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/

dschwa...@gmail.com

unread,
Aug 24, 2017, 11:55:40 AM8/24/17
to greasemonkey-users
hi,  thanks for the help but I can't get it to work.  I did create a simple popup script to test that greasemonkey is working on the page and that was good. 

Klaus Johannes Rusch

unread,
Aug 24, 2017, 4:07:44 PM8/24/17
to greasemon...@googlegroups.com
On 2017-08-24 17:55, dschwa...@gmail.com wrote:
> hi, thanks for the help but I can't get it to work.

In what way does it not work?  Can you provide a sample page where the
script fails?
Message has been deleted
Message has been deleted
Message has been deleted

dschwa...@gmail.com

unread,
Aug 24, 2017, 5:39:48 PM8/24/17
to greasemonkey-users, klaus...@atmedia.net
I got it.  there was a space that need a .  Thanks for the help
Reply all
Reply to author
Forward
0 new messages