Hi everyone
I have developed a PHP page which uses a few JavaScript functions and other JavaScript code to initially display today's date (and plus other data as well!). At the top of the PHP script is a PHP include file which determines whether or not today is BST - it creates a variable set to 1 if it is and 0 if it isn't. Pretty straight forward and it works as well.
This variable is used in the JavaScript to control what is output, depending whether or not BST is operating.
At the bottom of the PHP script is a bit of HTML which produces two buttons, with links to JavaScript functions. These buttons are named Yesterday and Tomorrow, and it shouldn't be too difficult to work out what they are used for.
These two JavaScript functions perform identically but with data for Yesterday or Tomorrow.
And this is the problem. When the script is first run, the BST test works as expected. But if a user clicks on either of the buttons mentioned above, the BST code is ignored because the variable originated from PHP and it has already been parsed.
So my question to all you clever JavaScript gurus is this....
Is there a simple, or complicated, JavaScript code that will determine whether or not BST is currently in force, and output a similar 1 for yes and 0 for no?
Thanks in advance
Terry
Part of the JavaScript code