Here is javascript code :
<script type="text/javascript">
var javascript_countdown = function ()
{
var time_left = 10; //number of seconds for countdown
var keep_counting = 1;
var no_time_left_message = 'Please Activate Javascript.';
function countdown()
{
if(time_left < 2)
{
keep_counting = 0;
}
time_left = time_left - 1;
}
function add_leading_zero( n )
{
if(n.toString().length < 2)
{
return '0' + n;
}
else
{
return n;
}
}
function format_output()
{
var hours, minutes, seconds;
seconds = time_left % 60;
minutes = Math.floor(time_left / 60) % 60;
hours = Math.floor(time_left / 3600);
seconds = add_leading_zero( seconds );
minutes = add_leading_zero( minutes );
hours = add_leading_zero( hours );
return minutes + ':' + seconds;
}
function show_time_left()
{
document.getElementById('javascript_countdown_time').innerHTML = format_output();//time_left;
document.getElementById('javascript_countdown_time_bottom').innerHTML = format_output();//time_left;
}
function no_time_left()
{
//document.getElementById('javascript_countdown_time').innerHTML = no_time_left_message;
//alert("");
document.FormAzmoon.submit();
}
return {
count: function () {
countdown();
show_time_left();
},
timer: function () {
javascript_countdown.count();
if(keep_counting) {
setTimeout("javascript_countdown.timer();", 1000);
} else {
no_time_left();
}
},
init: function (n) {
time_left = n;
javascript_countdown.timer();
}
};
}();
javascript_countdown.init(601);// Time Recorder Secends
</script>
This javascrip code is a reverse timer(10 minutes) in a page.
When timer = 0 it submits the page auto.
I want manipulate it for increase time.
I think best way to increase time is this line :
setTimeout("javascript_countdown.timer();", 1000);
change to :
setTimeout("javascript_countdown.timer();", 100000);
When i change this value on Inspector
of Inspect Element
in firefox nothing happens.
So what is the solution for that?
If there is another way other than firefox please teach me!
Also teach me how can i rewrite and manipulate a variable inside a function via console!