最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can you detect a user's ISP provider with JavaScript? - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

3 Answers 3

Reset to default 5

It'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.

发布评论

评论列表(0)

  1. 暂无评论