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

Run the Script

To use the default options, you only need to add the following to your own existing JS.

HTML

<div class="forecast" id="example1"></div>

JS

jQuery(document).ready(function () {
    jQuery("#example1").weatherForecast({
        appID: "your-app-id-here"
    });
});

That will produce a forecast using the default options. You can modify these options by modifying the script call as seen below:

HTML

<div class="today" id="example1"></div>
<div class="forecast" id="example2"></div>

JS

jQuery(document).ready(function () {
	jQuery("#example1").weatherForecast({
		city: "New York",
		region: "New York",
		country: "US",
		count: 1,
		theme: {
			backgroundColor: "#007cf3",
			color: "#fff",
			forceImageWhite: true,
			border: "none",
		},
		appID: "your-app-id-here"
	});
	
	jQuery("#example2").weatherForecast({
		city: "Los Angeles",
		region: "California",
		country: "US",
		appID: "your-app-id-here"
	});
});
PreviousUpdate the ScriptNextSample File

Last updated 3 years ago