Jump to content

setTimeout and variables!!


acidglitter

Recommended Posts

i have a function that starts out..

function confirm(trID, data){

 

and inside it i have

setTimeout(okaythen(trID),2000);

 

 

after the function ends i have

function okaythen(trID){
document.getElementById('row_1_2').innerHTML = trID;
}

 

right now i'm just trying to get the <td> to show its id (trID) just to make sure it works, but it doesn't for some reason. if i change the setTimeout to setTimeout(okaythen('okay'),2000); then inside the <td> it shows 'okay', but for some reason it won't carry a variable... i spent forever trying to fix this. i also tried setTimeout("okaythen(" + trID + ")",2000); but that won't work either. does anyone know what i can do to fix this??

Link to comment
https://forums.phpfreaks.com/topic/95133-settimeout-and-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.