Thanks for the reactions. but now, how do I see if the var has been set. *I'm using 'intvarM' as a var btw* Because when I click a hyperlink, or button, it says the vasn't been set. which is weird because the loop does update my fields.
this is how i start an interval: function joinRoomFunction(roomId){ $("#tables").load("pages/pages.php", {r: roomId}, function() { $("#myTable").tablesorter({widgets: ['zebra']}); alert('loaded'); $('button#stopINTERVAAL').click(function() {intvarM=clearInterval(intvarM);}); }); } function joinRoom(roomId){ var intvarM=window.setInterval("joinRoomFunction("+ roomId +")",5000); } now, i've added the $.click, but i get the error when clicking the button. this is the javascript file: http://www.waysoflife.eu/js/jsFunctiesPoker.js My navigation is quite simple. one lay-out,in divs. one main div's content, keeps loading in content using $.load(). when one specific type of content is loaded, the interval starts. but now, when i click something else it has to stop. I hope someone is able to help.. I really tried, but I'm stuck here. error: Foutdetails webpagina useragent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/ 4.0) timestamp: Sun, 23 Aug 2009 09:21:25 UTC Bericht: 'intvarM' is undefined line: 106 symbol: 61 Code: 0 URI: http://www.waysoflife.eu/js/jsFunctiesPoker.js