Run the Script
To use the default options, you only need to add the following to your own existing JS.
HTML
1
<div class="forecast" id="example1"></div>
Copied!
JS
1
jQuery(document).ready(function () {
2
jQuery("#example1").weatherForecast({
3
appID: "your-app-id-here"
4
});
5
});
Copied!
That will produce a forecast using the default options. You can modify these options by modifying the script call as seen below:
HTML
1
<div class="today" id="example1"></div>
2
<div class="forecast" id="example2"></div>
Copied!
JS
1
jQuery(document).ready(function () {
2
jQuery("#example1").weatherForecast({
3
city: "New York",
4
region: "New York",
5
country: "US",
6
count: 1,
7
theme: {
8
backgroundColor: "#007cf3",
9
color: "#fff",
10
forceImageWhite: true,
11
border: "none",
12
},
13
appID: "your-app-id-here"
14
});
15
16
jQuery("#example2").weatherForecast({
17
city: "Los Angeles",
18
region: "California",
19
country: "US",
20
appID: "your-app-id-here"
21
});
22
});
Copied!
Copy link