I am currently working on a project where I need to check if a computer visiting my webpage is connected to a specific network. My first idea was to compare the clients external IP with the current IP of the reference network, but obviously I would need to run a program on this network which checks the router's IP for changes. I thought about setting up a javascript/jquery code which searches on the client side for the local router and then (don't know yet how exactly) compares it to the router of the reference network.
Does anyone have an idea about an elegant solution for that? Doesn't matter if client- or server-side code.