var date_week_9 = new Array(); var date_day_9 = new Array(); $(function () { day10(); Foshorttime(); }); ///////////////////////////////////////////// function day10() { $.getJSON("/weather/data/10day.js", function (json) { if (json) { var dayNames = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); var datetime = new Date(json[0]["datetime"].replace(/-/g, "/")); //转换成Data(); for (var i = 0; i < 11; i++) { date_day_9.push(datetime.Format('MM-dd')); date_week_9.push(dayNames[datetime.getDay()]); datetime.setDate(datetime.getDate() + 1); } var datehour = datetime.getHours(); if (datehour >= 6 && datehour <= 11) { var strbtit = new Array(); strbtit.push("
" + date_day_9[0] + "
" + parseInt(json[0]["tmin1"]) + "~" + parseInt(json[0]["tmax1"]) + "℃
" + json[0]["wa1"] + "
"); strbtit.push("" + date_day_9[1] + "
" + parseInt(json[0]["tmin2"]) + "~" + parseInt(json[0]["tmax2"]) + "℃
" + json[0]["wa2"] + "
"); strbtit.push("" + date_day_9[2] + "
" + parseInt(json[0]["tmin3"]) + "~" + parseInt(json[0]["tmax3"]) + "℃
" + json[0]["wa3"] + "
"); strbtit.push("" + date_day_9[3] + "
" + parseInt(json[0]["tmin4"]) + "~" + parseInt(json[0]["tmax4"]) + "℃
" + json[0]["wa4"] + "
"); strbtit.push("" + date_day_9[4] + "
" + parseInt(json[0]["tmin5"]) + "~" + parseInt(json[0]["tmax5"]) + "℃
" + json[0]["wa5"] + "
"); strbtit.push("" + date_day_9[5] + "
" + parseInt(json[0]["tmin6"]) + "~" + parseInt(json[0]["tmax6"]) + "℃
" + json[0]["wa6"] + "
"); strbtit.push("" + date_day_9[6] + "
" + parseInt(json[0]["tmin7"]) + "~" + parseInt(json[0]["tmax7"]) + "℃
" + json[0]["wa7"] + "
"); strbtit.push("" + date_day_9[7] + "
" + parseInt(json[0]["tmin8"]) + "~" + parseInt(json[0]["tmax8"]) + "℃
" + json[0]["wa8"] + "
"); strbtit.push("" + date_day_9[8] + "
" + parseInt(json[0]["tmin9"]) + "~" + parseInt(json[0]["tmax9"]) + "℃
" + json[0]["wa9"] + "
"); strbtit.push("" + date_day_9[9] + "
" + parseInt(json[0]["tmin10"]) + "~" + parseInt(json[0]["tmax10"]) + "℃
" + json[0]["wa10"] + "
"); strbtit.push("" + date_day_9[1] + "
" + parseInt(json[0]["tmin1"]) + "~" + parseInt(json[0]["tmax1"]) + "℃
" + json[0]["wa1"] + "
"); strbtit.push("" + date_day_9[2] + "
" + parseInt(json[0]["tmin2"]) + "~" + parseInt(json[0]["tmax2"]) + "℃
" + json[0]["wa2"] + "
"); strbtit.push("" + date_day_9[3] + "
" + parseInt(json[0]["tmin3"]) + "~" + parseInt(json[0]["tmax3"]) + "℃
" + json[0]["wa3"] + "
"); strbtit.push("" + date_day_9[4] + "
" + parseInt(json[0]["tmin4"]) + "~" + parseInt(json[0]["tmax4"]) + "℃
" + json[0]["wa4"] + "
"); strbtit.push("" + date_day_9[5] + "
" + parseInt(json[0]["tmin5"]) + "~" + parseInt(json[0]["tmax5"]) + "℃
" + json[0]["wa5"] + "
"); strbtit.push("" + date_day_9[6] + "
" + parseInt(json[0]["tmin6"]) + "~" + parseInt(json[0]["tmax6"]) + "℃
" + json[0]["wa6"] + "
"); strbtit.push("" + date_day_9[7] + "
" + parseInt(json[0]["tmin7"]) + "~" + parseInt(json[0]["tmax7"]) + "℃
" + json[0]["wa7"] + "
"); strbtit.push("" + date_day_9[8] + "
" + parseInt(json[0]["tmin8"]) + "~" + parseInt(json[0]["tmax8"]) + "℃
" + json[0]["wa8"] + "
"); strbtit.push("" + date_day_9[9] + "
" + parseInt(json[0]["tmin9"]) + "~" + parseInt(json[0]["tmax9"]) + "℃
" + json[0]["wa9"] + "
"); strbtit.push("" + date_day_9[10] + "
" + parseInt(json[0]["tmin10"]) + "~" + parseInt(json[0]["tmax10"]) + "℃
" + json[0]["wa10"] + "
"); strbtit.push(""+json[0]["tmin"]+"-"+json[0]["tmax"]+"℃
" + json[0]["tmin"] + "-" + json[0]["tmax"] + "℃
" + new Date(datetime).Format("dd日") + "(" + dayNames[datetime.getDay()] + ")" + new Date(datetime).Format("hh") + "时
"; strcontent += ""; var sid = wc_lastJson[wc_lastJson.length - 1]["sid"]; if (sid == "G2212") sid = "G7045"; if (sid == "G2229") sid = "G2289"; $.ajaxSettings.async = false; //气压 $.getJSON("/weather/data/aws_inst_fo_" + sid + ".js", function (json2) { $(json2).each(function (index, item2) { if (item2.datetime == json[0]["issue_datetime"]) { pa = item2.p; return false; } }) }); strcontent += "气压:" + pa + "hPa
"; strcontent += "湿度" + shidu + "
"; strcontent += "" + json[0]["wind"] + "
"; strcontent += "