Is there a way to make an action available only at a specific time that was programmed in advance in HTML?
For example: A radio player that will only work at a certain time and at other times the link is not active
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, use javascript to do this. Many ways:
1st method – Link controlled by javascript function
This is probably the easiest way, as long as the functionality is controlled by a link
2nd method – put a box on top of the player so it can’t be clicked
Be careful if security is important
If you use javascript to get the local time on the user’s computer, be aware that a user may MANIPULATE their clock. So you may not be able to trust it.
You can mitigate this risk by getting the server to save the actual time in a javascript variable on page load. However, the user can still manipulate their clock if you are using timers to find the time change.
If it is important, you should probably do an AJAX request to check the server time before allowing a link click to start the player (eg. with the 1st method).