If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Same view on different devices

I made a simple page with html and Jquery Mobile. There I have 2 flipswitches (on / off). If I browse to the webpage with my computer and click on flipswitch 1, the flipswitch goes to "On".

If I now browse with my mobile phone to the same webpage, the flipswitch is still on "Off". How can I view the same state of the flipswitch on different devices.

This is an important detail for me because those switches are "connected" with my shutters. I will change the "On / Off" text to "Shutters Up / Shutters Down".

For example: My wife clicks on the Shutters up button (the shutters goes up ... :-) ), but if I go to the webpage with my mobile phone after x minutes, I will see the button on state "Shutter Down" while the shutters are actually up.

First, Javascript and JQuery are client side. That means that the only thing that sees the state of the switch (on/off, up/down, whatever) is the device that changes the state. In and of itself/themselves, Javascript and Jquery cannot pass that state to another device. You will need to save that state to a server so another device can see it.

On the other hand, and perhaps more importantly, the actual state of the device should be what you see. In other words, your shutters need to be able to report that they are up/down, open/closed. That should be what you really see, not who flipped the switch last.