function showTime(){
var now =newDate();
var nowTime = now.toLocaleString();
var date = nowTime.substring(0,10);//截取日期
var time = nowTime.substring(10,17);//截取时间
document.getElementById('rq').innerHTML = date +" "+ time;setTimeout("showTime();",60000);}//定位当前城市
var cityName;
var map =newBMap.Map("container");
var nowCity =newBMap.LocalCity();
nowCity.get(bdGetPosition);
function bdGetPosition(result){
cityName = result.name;//当前的城市名// console.log(cityName);refreshWeather(cityName);
$('.cityName').html(cityName)}
var map =newBMap.Map("cart");
var nowCity =newBMap.LocalCity();// 获取天气预报
function refreshWeather(cityName){
jQuery.support.cors =true;
console.log('天气1',jQuery.support.cors)
var url =encodeURI("http://wthrcdn.etouch.cn/weather_mini?city="+ cityName);
$.ajax({
url: url,
type:'get',
dataType:"json",
async:false,
success: function (data){
console.log('天气2',data)
$('.TC').html(data.data.wendu);
$('.weatherType').html(data.data.forecast[0].type);}});