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
checkUrlFaviconTimer = setTimeout("getFavicon()",200);
|
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);
});
Last edited by Skeddles; 01-18-2012 at 10:55 AM..
|