Memory leak in jQuery AJAX calls
问题 I've written a little chat-box widget which runs an ajax call every second, to fetch new messages that have been posted. The problem is it's leaking memory, and after only about 15 mins of being open it crashes my browser (Firefox). It's probably me, as I am a relative newbie, and I'm sure I've missed something out or am not unsetting my variables, etc.. var chat = {} chat.fetchMessages = function() { $.ajax({ url: '/chat_ajax.php', type: 'post', data: { method: 'fetch'}, success : function