What's wrong? Why don't work stop funkction?
I think that the poor turn to the function, but otherwise I do not know ...
<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
$(document).ready(function()
{
//Paleidimo funkcija
var time_ref = setTimeout(function()
{
var time_ref2 = setInterval(function()
{
$('#time_now').load('time.php?id='+ Math.random());
}, 1000);
}, 3000);
//Laiko sustabdymo funkcija
$("#stop").click(function()
{
clearInterval(time_ref2);
});
});
</script>
</head>
<body>
<div align="center" id="time_now">--:--:--</div>
<button id="stop">Stop</button>
</body>
</html>