<script> <BR>function load(cid) <BR>{ <BR>var xmlhttp; <BR>if (window.XMLHttpRequest) <BR>{// code for IE7+, Firefox, Chrome, Opera, Safari <BR>xmlhttp=new XMLHttpRequest(); <BR>} <BR>else <BR>{// code for IE6, IE5 <BR>xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); <BR>} <BR>xmlhttp.open("GET","date.jsp?cid="+cid,false); <BR>xmlhttp.send(); <BR>var obj = eval("("+ xmlhttp.responseText+")"); <BR>//var obj=JSON.parse(xmlhttp.responseText); //IE8以上 <BR>document.getElementById("test").innerHTML=obj.weatherinfo.city+":"+obj.weatherinfo.weather1+" "+obj.weatherinfo.temp1; <BR>} <BR></script>
天气情况