| " <input id="quantity_1" name="quantity_1" type="hidden" value="20.00" /> " |
to " " <input id="quantity_1" name="quantity_1" type="hidden" value="25.00" /> " |
// @run-at document-startfunction f(){
--
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/greasemonkey-users/-/6tZm8EInLGcJ.
To post to this group, send email to greasemon...@googlegroups.com.
To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
// @run-at document-start(function f(){
So if the page changes in the future to not have a quantity_1 element, greasemonkey will run f every 5 milliseconds... forever. Yeah, f is small and quick, but even small and quick at 200 times per second, doing something that will never succeed, seems bad.
Brian
On 7/20/12 11:54 AM, Hans Henrik Bergan wrote:
// @run-at document-startfunction f(){
try{
document.getElementById('quantity_1').value="25.00";
}catch(e){setTimeout(f,5);}
}
f();
will use some cpu (until it has done it's task), and its quite hackish, but i guess i think it should work
On Friday, 13 July 2012 00:15:15 UTC+2, Console wrote:I want to immediately change this javascript value on the fly before it redirects me to the page with grease monkey. I am a novice on grease monkey and spent quiet of a few hours reading and experimenting with no luck, if anyone can give me a helping hand on this I would appreciate it. This is the code I want to replace:--
" <input id="quantity_1" name="quantity_1" type="hidden" value="20.00" /> "
to
" " <input id="quantity_1" name="quantity_1" type="hidden" value="25.00" /> "
If any more info is needed let me know, thank you in advance.
You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/greasemonkey-users/-/6tZm8EInLGcJ.
To post to this group, send email to greasemonkey-users@googlegroups.com.
To unsubscribe from this group, send email to greasemonkey-users+unsub...@googlegroups.com.