Ciao,
Come faccio a fare in modo che il seguente codice
visualizzi ad es.Codice:<html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> </head> <body> <!--Free usage of our API is limited to 1,000 API requests per day. If you exceed 1,000 requests in a 24 hour period we'll return a 429 HTTP status code to you. If you need to make more requests, or need SSL support, see our paid plans, which all have soft limits.--> <hr/> <div id="ip"></div> <div id="address"></div> <input type="text" value="" id="city" /> <script type="text/javascript"> $.get("http://ipinfo.io", function (response) { $("#address").html("Location: " + response.ip + ", "+ response.city + ", "+ response.region + ", " + response.country); $("#details").html(JSON.stringify(response, null, 4)); $("#city").html(response.city); document.getElementById('city').value = response.city; }, "jsonp"); </script> </body> </html>
dove l'immagine punta a:Codice:8.8.8.8, Mountain View, California, US
e dove "$loc" è una variabile che assume il valore del campo "loc" fornito dal jsonCodice:http://maps.googleapis.com/maps/api/staticmap?visible=42.402354,12.862117|$loc&zoom=2&size=640x640&scale=4&format=png&maptype=road&markers=size:big|color:red|label:V|$loc&visual_refresh=true
per rimanere nell'esempio di 8.8.8.8 loc è uguale a 37.3860,-122.0838
spero di essermi spiegato e grazie a chi risponderà

LinkBack URL
About LinkBacks

