AndyPSV
asked on
Jquery wait
I want to make my script wait for 4 seconds after performing an action.
Typically it works like this perfect:
...
});
},
onComplete: function (a, b ,c, d, e) {
var size = Math.round(c.size/1024);
$.jGrowl('<p></p>'+c.name+ ' - '+size+'KB', {
theme: 'success',
header: 'Upload Complete',
life: 4000,
sticky: false
});
window.location.replace('< % $URL %>profile/photo');
}
});
...
I want to delay: " window.location.replace('< % $URL %>profile/photo'); "
4 seconds
how to do it?
Typically it works like this perfect:
...
});
},
onComplete: function (a, b ,c, d, e) {
var size = Math.round(c.size/1024);
$.jGrowl('<p></p>'+c.name+
theme: 'success',
header: 'Upload Complete',
life: 4000,
sticky: false
});
window.location.replace('<
}
});
...
I want to delay: " window.location.replace('<
4 seconds
how to do it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
});
},
onComplete: function (a, b ,c, d, e) {
var size = Math.round(c.size/1024);
$.jGrowl('<p></p>'+c.name+ ' - '+size+'KB', {
theme: 'success',
header: 'Upload Complete',
life: 4000,
sticky: false
});
//======================== ========== =========
// reference from Javascript
sleep(4000);
//======================== ========== =========
window.location.replace('< % $URL %>profile/photo');
}
});
},
onComplete: function (a, b ,c, d, e) {
var size = Math.round(c.size/1024);
$.jGrowl('<p></p>'+c.name+
theme: 'success',
header: 'Upload Complete',
life: 4000,
sticky: false
});
//========================
// reference from Javascript
sleep(4000);
//========================
window.location.replace('<
}
});
ASKER