butterandfly / project_9

Blog & Remark
0 stars 0 forks source link

前端获取ip #222

Open butterandfly opened 9 years ago

butterandfly commented 9 years ago

要调用别人的借口:

<script>
  jQuery(function($){
    var url = 'http://chaxun.1616.net/s.php?type=ip&output=json&callback=?&_='+Math.random();
    $.getJSON(url, function(data){
      window.sf_UserIp = data.Ip;
    });
  });
</script>