Results 1 to 2 of 2

Thread: Same view on different devices

  1. #1
    Join Date
    Apr 2014

    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.

    Any suggestions or hints?
    Thanks !

  2. #2
    Join Date
    Oct 2013
    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.

    Some reading:

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center