Quote:
|
(it becomes disabled when it saves and is only enabled once changes are made to the page)
|
That code isn't shown here. I assume it's independent of the grease monkey stuff?
That code doesn't look too ugly, to me (well, except that your code indentations isn't pretty <grin/>).
I think you could get away with doing it like this, though:
Code:
<script>
(
function()
{
var button = document.getElementById("store");
button.onclick = function(){ alert("saved"); } // optional
function clickIt()
{
if ( ! button.disabled) { button.click( ); }
}
setInterval(clickIt,10000);
}
)();
</script>
After all, how long is a save going to take? Surely not more than 9.9 seconds?
So why bother with clearing and setting the timeout over and over again?