function is not defined when using setTimeout?
Hello.
I have this code:
- setTimeout("urlcode()",2000);
which runs on a click event, it runs on the click event but i get this error in firebug:
- urlcode is not defined
It should call this function:
- function urlcode(){
- //My code here
- };
But if I just call the function without the setTimeout then it runs the function. What am i doing wrong?
Thanks.