cloudy

Author Topic: Another question about the Carter Lake template  (Read 1417 times)

0 Members and 1 Guest are viewing this topic.

Online CNYWeather

  • Professional Trophymaker!
  • Posts: 1,431
  • Rome, New York
    • CNYWeather.com
Another question about the Carter Lake template
« on: October 14, 2006, 05:21:59 PM »
During the fall and winter, we tend to have a lot of Special Weather Statements
due to Lake Ontario lake effect snow.

Like right now, there is a "special weather statement" from the
NWS. Any way I can get the warnings javascript on the template to
recognize that also and put a box up at top the page?

Here is the code I have currently:
Code: [Select]
<script type="text/javascript">
<!-- Javascript advisory message only appears when there is an advisory -->
<!--
var warning = "NO CURRENT ADVISORIES".toUpperCase();
var link = "wx4.html";
if (warning != "NO CURRENT ADVISORIES"){
   if (warning.indexOf("WATCH") > 0) {
       document.write('<div class="watchBox"><a href="' + link + '" style="color: #FFFFFF;"><b><span
style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b> IN EFFECT ... [Click here
for more info]</a></div><br />');
   }
   else if (warning.indexOf("WARNING") > 0) {
       document.write('<div class="warningBox"><a href="' + link + '" style="color: #FFFFFF;"><b>
span style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b> IN EFFECT ... [Click here
for more info]</a></div><br />');
   }
   else {
       document.write('<div class="advisoryBox"><a href="' + link + '" style="color: #000000;"><b><span
style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b><b>   </b>    [Click here
for more info]</a></div><br />');
   }
}
//-->
</script>

Thanks!!  :D

Tony

CNYWeather.com
CWOP: CW2352
WeatherUnderground: KNYWESTM1


http://www.CNYWeather.com

I Make Trophies Too!
http://www.speedyawards.com

Offline carterlake

  • Tom Chaplin
  • Posts: 2,273
  • Carter Lake, Iowa USA
    • Carter Lake, Iowa Weather
Re: Another question about the Carter Lake template
« Reply #1 on: October 14, 2006, 05:56:43 PM »
During the fall and winter, we tend to have a lot of Special Weather Statements
due to Lake Ontario lake effect snow.

Like right now, there is a "special weather statement" from the
NWS. Any way I can get the warnings javascript on the template to
recognize that also and put a box up at top the page?

Here is the code I have currently:
Code: [Select]
<script type="text/javascript">
<!-- Javascript advisory message only appears when there is an advisory -->
<!--
var warning = "NO CURRENT ADVISORIES".toUpperCase();
var link = "wx4.html";
if (warning != "NO CURRENT ADVISORIES"){
   if (warning.indexOf("WATCH") > 0) {
       document.write('<div class="watchBox"><a href="' + link + '" style="color: #FFFFFF;"><b><span
style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b> IN EFFECT ... [Click here
for more info]</a></div><br />');
   }
   else if (warning.indexOf("WARNING") > 0) {
       document.write('<div class="warningBox"><a href="' + link + '" style="color: #FFFFFF;"><b>
span style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b> IN EFFECT ... [Click here
for more info]</a></div><br />');
   }
   else {
       document.write('<div class="advisoryBox"><a href="' + link + '" style="color: #000000;"><b><span
style="text-transform: uppercase;">NO CURRENT ADVISORIES</span></b><b>   </b>    [Click here
for more info]</a></div><br />');
   }
}
//-->
</script>

Thanks!!  :D



You are using two different sources to pull advisories. The home page is using WD and WD tags. The advisories page is using the advisories PHP code in an <IFRAME>.

Any time you use two different ways to get data, you're going to occasionally end up with times when they don't agree. So, your choices are: 1) Only use one source for advisories; 2) Live with the occasional inconsistencies.

WD; Davis VP2 6153; Quickcam for Notebooks Pro; Boltek w/ Nexstorm; GRLevel3; Live NOAA radio

 

cumulus