JSON API-FreeCodeCamp

这部分主要介绍了两个功能,获取json数据和获取位置,jquery现在用的越来越少,这段大概看下就可以过了

  1. convert json to html

Cat Photo Finder

The message will go here
  1. access user's location
    Every browser has a built in navigator that can give us this information.
if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
            $("#data").html("latitude: " 
                             + position.coords.latitude + "
longitude: " + position.coords.longitude); }); }

你可能感兴趣的:(JSON API-FreeCodeCamp)