Wednesday 15 July 2015

How can I capture the internal LAN IP address using javascript -


The first post needs some help. I am creating an internal network that has a range of iPad which is used by my home Is being done to control. I am creating a website that is using Javascript which sends serial control command to various devices connected to my server. I want to have 5 iPads in 5 different rooms with each separate control home page. So control for my bedroom is going to be different from the control for my living room etc. ... Although on each of my ipads I have a NAV bar that will allow me to jump page in a separate room for control I'm stuck in the thing, I want to be able to click on the Home button on any page in any room and the iPad in that room will be automatically redirected to the home page. The iPad in the room that is special. I can see the only way to do this is to set up a static IP on each iPad and the Home button has to go back to the index where the IP address of the requested iPad is read and then The correct redirect is done for that iPad based home page based on its static IP address. Kicker I am not using PHP. I can use .asp, but I Asp is not known, if someone can help, it would be great. I have a code snippet, a different post but the result gives me my external IP which is what I am trying to do, it is useless for this. I goes to IPAD index.html every time a person connects through a form with a specific name on each iPad and while saving information in the form of a cookie, the cookie is read and And accordingly accordingly, it is redirected accordingly.

  & lt; Script type = "text / javascript" language = "javascript" & gt; Function myIP () {if (window.XMLHttpRequest) {xmlhttp = new XMLHttpRequest (); } And {xmlhttp = new ActiveXObject ("Microsoft.XMLHTTP"); } Xmlhttp.open ("GET", "http://jsonip.appspot.com/", Incorrect); Xmlhttp.send (); HostipInfo = xmlhttp.responseText; Obj = JSON.parse (hostipInfo); . Document.getElementById ("IP") value = obj.ip; . Document.getElementById ("Address") value = obj.address; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body onload = "myIP ()" & gt; IP: & lt; Input type = "text" id = "ip" name = "ip" /> Address: & lt; Input type = "text" id = "ADDRESS" name = "ADDRESS" />    

Which control to display on an external factor (IP)? Controlling is priceless and perhaps for a bit of a bit more trouble, for the sake of control

To indicate the control related to the device, I will have a smaller button / checkbox on your page more favorably. Effectively setting that page as a homepage

As stated in his comment on @Tlato, you can use cookies to continue the configuration state. Using localStorage is the best bet because it ends Does not happen.

No comments:

Post a Comment