FrankieB Posted February 18, 2007 Share Posted February 18, 2007 Greetings everybody. I am currently trying to do some time sensitive CSS on my website. What I am trying to do is find the local time on the users machine (not the server time) that is viewing my website, and then display a different style sheet depending on what time it is. I tried using just Javascript and PHP, but I couldn't figure out how to get the user's time in Javascript and send it to the PHP code to choose which style sheet to display, and thats where I found out about Ajax. I followed the basic tutorial on the website here, and I am not sure if I am doing this right. The only difference is that I'm sending the hour (represented in military time) to the page via Ajax. The problem I have encountered is that the page doesn't get the variable at all. I've attributed this to the PHP all being parsed first, and then Ajax, so yes even though the page is getting the time, it doesn't matter because its after the fact. Is there a better way I can go about doing this? Is there something I am doing wrong? How do I get the page to get the date first, and then load everything else? Thanks for reading! Note: I am new to all of this, so please bear with me. Wouldn't this make my life much easier as well if I all did this once with a session and then saved it there so that this Ajax doesn't have to load on every page? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.