Sample File

You can add this script by simply adding the following code to your html, or by adding the divs we previously discussed. The following code adds two divs (IDs, example1 and example2), once added you need to reference those IDs in your init.js script.

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="utf-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <title>My Weather</title>
   <link href="/weather.min.css" rel="stylesheet">
</head>
<body>
   <div class="today" id="example1"></div>
   <div class="forecast" id="example2"></div>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
   <script src="/weather.min.js"></script>
   <script src="/init.js"></script>
</body>
</html>

The last thing you need to do is add the script variables to your init.js that customize your forecast data.

Last updated