thisisnuts123 Posted November 3, 2007 Share Posted November 3, 2007 function sitepop(ret_value){ var uuu = ret_value; setTimeout("alert(uuu);", 2000); } this gives me uuu un defiend any ideas to why? if i change this to the followingthen it works function sitepop(ret_value){ var uuu = ret_value; alert(uuu); } how can i do this with a delay?? thanks!!! Link to comment https://forums.phpfreaks.com/topic/75871-settimeout-function/ Share on other sites More sharing options...
mainewoods Posted November 3, 2007 Share Posted November 3, 2007 the uuu variable has only local scope and is destroyed after the function returns. try this instead: function sitepop(ret_value){ var uuu = ret_value; setTimeout("alert('" + uuu + "');", 2000); //i'm adding single quotes around the parameter } Link to comment https://forums.phpfreaks.com/topic/75871-settimeout-function/#findComment-384327 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.