Weather Forecasts, Doppler Radar Reports and Weather

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Weather Forecasts, Doppler Radar Reports and Weather

Maps from CNN.com

';

Element.update(container, htmlStr);

cnnShowCityMatches('cnnWeatherFindWeatherResultsPop');

function displayNoMatch(val)

var container='weatherLookup';

var htmlStr='

';

Element.update(container, htmlStr);

function urlEncode(str)

str=trimWS(str);

str=str.replace(/st./i,'saint');

str=str.replace(/mt./i,'mount');

str=escape(str);

return str;

function urlDecode(str)

return unescape(str);

function checkZip(str)

str=trimWS(str.toString());

var bool=(str.match(/^d5$/)!=null && str!='00000'?true:false);

return bool;

function trimWS(str)

str=str.replace(/,/g,' ');

str=str.replace(/^s*(S+)*s*$/,"$1");
str=str.replace(/(s1)s*/g,"$1");

return str;

function updateWithNewData(name,zip,locCode)

window.location.href = window.location.pathname+'?locCode=' + locCode + '&zipCode=' + zip;

function getUSCities(selectB)

//ajaxFunction("cities","xml", selectB.options[selectB.selectedIndex].value,true, processCities);

var qryArg = selectB.options[selectB.selectedIndex].value;

var validatorUrl='/weather/drillDown';

var validatorArgs="typeOfSearch=cities&typeOfResult=json_html&key=" + urlEncode(qryArg) +


"&domestic=true";

var callBack = processCities;

checkInput(qryArg,validatorUrl, validatorArgs,callBack);

function getInternationalCities(selectB)

//ajaxFunction("cities","xml", selectB.options[selectB.selectedIndex].value,false, processCities);

var qryArg = selectB.options[selectB.selectedIndex].value;

var validatorUrl='/weather/drillDown';

var validatorArgs="typeOfSearch=cities&typeOfResult=json_html&key=" + urlEncode(qryArg) +


"&domestic=false";

var callBack = processCities;

checkInput(qryArg,validatorUrl, validatorArgs,callBack);

function getUSStates(selectB)

var qryArg = selectB.options[selectB.selectedIndex].value;

var validatorUrl='/weather/drillDown';

var validatorArgs="typeOfSearch=country&typeOfResult=json_html&key=" + urlEncode(qryArg) +


"&domestic=true";

var callBack = processStates;

checkInput(qryArg,validatorUrl, validatorArgs,callBack);
function processUSRegions(selectB)

var qryArg = selectB.options[selectB.selectedIndex].value;

var validatorUrl='/weather/drillDown';

var validatorArgs="typeOfSearch=allstates&typeOfResult=json_html&key=" + urlEncode(qryArg) +


"&domestic=true";

var callBack = processStates;

checkInput(qryArg,validatorUrl, validatorArgs,callBack);

function processInternationalCountries(options,idStr)

marker = document.getElementById("cnnWeatherStateBox");

marker.innerHTML = "";

div = document.createElement("div");

div.id = 'cnnDDWeatherState_wrap';

div.className = 'cnnPad8Top';

marker.appendChild( div );

form = document.createElement("form");

countrySelect = document.createElement("select");

countrySelect.className = "cnnWeatherStateOptions";

countrySelect.id = "cnnDDWeatherState_list";

opt = document.createElement("option");

opt.appendChild(document.createTextNode("2. select a country"));

opt.value = "0";

countrySelect.appendChild(opt);

processResponseAsSelect(countrySelect,options);

form.appendChild(countrySelect);

marker.appendChild(form);

cnnDD.buildDropdown('cnnDDWeatherState', 210, 210, 10);


showUSStates();

countrySelect.onchange = function()

if(countrySelect.selectedIndex != 0)

getInternationalCities(countrySelect);

function doInternationalCountrySearch(selectB)

if(selectB.selectedIndex != 0)

var qryArg = selectB.options[selectB.selectedIndex].value;

var validatorUrl='/weather/drillDown';

var validatorArgs="typeOfSearch=country&typeOfResult=json_html&key=" + urlEncode(qryArg) +


"&domestic=false";

var callBack = processInternationalCountries;

checkInput(qryArg,validatorUrl, validatorArgs,callBack);

function processResponseAsSelect(ss,options)

for(i=0; i 0)

msg.innerHTML = "We found Several Locations for "" +


document.getElementById("cnnFindWeatherTextBox").value + """;

else

msg.innerHTML = "Sorry. No results found for "" +


document.getElementById("cnnFindWeatherTextBox").value + """;

if(locations.length != 1) cnnShowCityMatches('cnnWeatherFindWeatherResultsPop');

//AjaxFunction

function ajaxFunction(typeOfSearch,typeOfResult,key,domestic, fnc,url)

try

// Firefox, Opera 8.0+, Safari

xmlHttp=new XMLHttpRequest();

catch (e) // Internet Explorer


try

xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");

catch (e)

try

xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

catch (e)

alert("Your browser does not support AJAX!");

return false;

if(url)

xmlHttp.open("GET",url,true);

if(fnc)

xmlHttp.onreadystatechange = fnc;

else

//document.write("/weather/drillDown?typeOfSearch="+ typeOfSearch +"&typeOfResult=" +


typeOfResult + "&key=" + key + "&domestic=" + domestic);

xmlHttp.open("GET","/weather/drillDown?typeOfSearch="+ typeOfSearch +"&typeOfResult=json"


+ "&key=" + key + "&domestic=" + domestic,true);

xmlHttp.send(null);

function showCityMatches(whichLayer)ie)

tipobj.style.visibility="visible";

// document.getElementById('cnnWeatherRegionBox').style.display="none";

// document.getElementById('cnnWeatherStateBox').style.display="none";

// document.getElementById('cnnWeatherCityBox').style.display="none";

// return false;

function hideCityMatches(whichLayer)ie)

tipobj.style.visibility="hidden";

Enter city name or zip code to get forecasts for cities around the world
http://weather.cnn.com/weather/forecast.jsp?zipCode=92602

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy