Jump to content

Countdown than run script


Lukela

Recommended Posts

Here's my situation, Im building a Browser-based game. In this games you have these troops that you are able to attack people's villages and such, when you attack someone you need to take the time difference between them two and that will be how long it takes to reach the target. I can use PHP to calculate the time, but I need a JS script that once the time hits 00:00:00 it would run the attack script to calculate the battle. Anyone here can help?

Link to comment
Share on other sites

not directly no. a jS script will only continue to run whilst the page the script is embedded in is loaded in the browser window. this does not mean that the script would die if you were to utilize an <iframe> to display another page within the current page.

 

Hope to have helped.

 

Jos.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.