Skip to content

Instantly share code, notes, and snippets.

@tysone
Created April 1, 2014 14:25
Show Gist options
  • Save tysone/9915169 to your computer and use it in GitHub Desktop.
Save tysone/9915169 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>My Page Title</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<style type="text/css">
#temp {font-weight: bold; background-color: yellow;}
</style>
</head>
<body>
<h1>The Weather Today!</h1>
<p>The weather today in New York is <span id="temp"></span></p>
<script type="text/javascript">
$.getJSON('http://api.openweathermap.org/data/2.5/weather?q=New%20York,USA&units=imperial', function(data){
$('#temp').text(data.main.temp + ' degrees');
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment