Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JSON requests using API in Javascript

<html>
   <meta charset="UTF-8">
   <head>
      <title>Sample page</title>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
      <script>
      var settings = {
        "url": "https://api.openweathermap.org/data/2.5/weather?zip=95050&units=imperial&appid=APIKEY",
        "method": "GET",
        "timeout": 0,
      };

      $.ajax(settings).done(function (response) {
        console.log(response);
        var content = response.wind.speed;
        $("#windSpeed").append(content);
      });

      </script>
   </head>
   <body>
      <h1>Sample Page</h1>
      wind speed: <span id="windSpeed"></span>
   </body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to get the lower triangular matrix out of a matrix matlab 
Javascript :: form submit jquery 
Javascript :: how to reload automaticaly in vue 
Javascript :: js number to string 
Javascript :: ondragover js 
Javascript :: react state not updating immediately 
Javascript :: js variable for key obj 
Javascript :: import downloadcsv from "vue-json-csv"; 
Javascript :: check if browser is chrome mobile 
Javascript :: contact form angular material 
Javascript :: pass arguments into require javascript 
Javascript :: javascript compare timestamp 
Javascript :: angular get route last segment 
Javascript :: react get current date minus 7 days 
Javascript :: what is javascript used for 
Javascript :: capitalize first letter of a string 
Javascript :: sequelize include stop returning the join table 
Javascript :: setstate react 
Javascript :: pop-under window before current page 
Javascript :: nested model in angular 
Javascript :: Repeat a String Repeat a String-Javascript 
Javascript :: arguments object in javascript 
Javascript :: how to use yarn to create next app 
Javascript :: express project structure 
Javascript :: js reverse 
Javascript :: create new project angular 
Javascript :: jquery scroll to element toggle menu item 
Javascript :: react usecallback hook 
Javascript :: back to top scroll animation jquery 
Javascript :: add object to array javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =