jquery set timer not working
so on the click event, when I call the function getFavicon(), it works, but on the very next line when the timer is supposed to call it it doesn’t work.
Firebug says
Quote:
|
getFavicon is not defined |
Code:
//Favicon
function getFavicon() {
$.get('/homepage/getfavicon.php', { url: $('add-link-url').val() }, function(data) {
alert(data);
});
}
var checkUrlFaviconTimer;
$('input[name="add-link-url"]').click(function() {
clearTimeout(checkUrlFaviconTimer);
getFavicon();
checkUrlFaviconTimer = setTimeout("getFavicon()",200);
});View full post on Tycoon Talk
jquery, timer, working