javascript add delay to php before creating a popup code example Example: sleep php <?php sleep(4); echo "Done\n"; ?>