I have static webpage. In that page I want to get the ISP provider & location of a user, using JavaScript.
Is there any way to do this using only JavaScript, or will I need to use other tools to do so?
I have static webpage. In that page I want to get the ISP provider & location of a user, using JavaScript.
Is there any way to do this using only JavaScript, or will I need to use other tools to do so?
Share Improve this question edited Mar 14, 2013 at 8:39 guerda 24.1k28 gold badges100 silver badges151 bronze badges asked Mar 13, 2013 at 11:25 Devi ADevi A 3241 gold badge7 silver badges16 bronze badges 2- 1 possible duplicate: stackoverflow./questions/9289439/how-to-capture-isp-name – jlasarte Commented Mar 13, 2013 at 11:26
- With only a static webpage (and no third-party services) you wouldn't be able to get the IP of the user using Javascript (so that you can find their location/ISP), as far as I know. Someone correct me if I'm wrong. – Qantas 94 Heavy Commented Mar 13, 2013 at 11:36
3 Answers
Reset to default 5It's not possible to detect the ISP provider using only JavaScript, if you would be willing to use PHP however, it's very simple:
<?php
$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
echo $hostname;
?>
you can call http://ip-api./json by a Get http request and the response is a json containing user's IP data including "isp"
You can get the geo location using geo location API. I don't think it is possible to get the ISP using JavaScript on the client.