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
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);
    });


View full post on Tycoon Talk

, ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved