a nie działa jeśli utworze sobie normalny plik np. a.html z tym samym kodem?
<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta charset="utf-8" /> <style type="text/css"> #result{ width: 300px; height: 400px; background-color: red; } </style> <script> var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: ["Berlin"], destinations: ["Frankfurt"], travelMode: google.maps.TravelMode.DRIVING, }, callback); function callback(response, status) { console.log(response); $("#result").text(response.rows[0].elements[0].distance.text + " and " + response.rows[0].elements[0].duration.text); } </script> </head> <body> </body> </html>