jQuery Forecaster
Demo
  • Script Information
  • Installation and Setup
    • Get Your API Key
    • Install the Script
    • Update the Script
    • Run the Script
    • Sample File
  • Options
  • Default Options
  • Options
  • Examples
  • Additional
    • Common Errors
    • Change Log
Powered by GitBook
On this page
  1. Installation and Setup

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.

PreviousRun the ScriptNextDefault Options

Last updated 3 years ago