thinkphp js取值
<divclass="top-local"><ahref="<{:U('city/index')}>"class="top-addr">{:bao_msubstr($ci...
<div class="top-local">
<a href="<{:U('city/index')}>" class="top-addr">{:bao_msubstr($city_name,0,2,false)}> <i class="icon-angle-down"></i></a>
</div>
我想把city_name的值在JS中显示出来.请问怎么能取到呢???
function getlat(lng,lat){
//alert('开始获取');
var map = new BMap.Map("allmap");
var point = new BMap.Point(lng,lat);
map.centerAndZoom(point,12);
var geoc = new BMap.Geocoder();
var pt = point;
geoc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
var start_city=addComp.city;
var start_addr=addComp.city + addComp.district + addComp.street + addComp.streetNumber;
setCookie("start_city",start_city);
//setCookie("start_addr",start_addr);
if(getCookie("cityname")!=start_city&&getCookie("cityname")!=null){
if(confirm("检测到您的当前位置为"+start_city+"是否切换")){
jump_city(start_city);
}
}
加在"是否切换"后...应该怎么加呢? 展开
<a href="<{:U('city/index')}>" class="top-addr">{:bao_msubstr($city_name,0,2,false)}> <i class="icon-angle-down"></i></a>
</div>
我想把city_name的值在JS中显示出来.请问怎么能取到呢???
function getlat(lng,lat){
//alert('开始获取');
var map = new BMap.Map("allmap");
var point = new BMap.Point(lng,lat);
map.centerAndZoom(point,12);
var geoc = new BMap.Geocoder();
var pt = point;
geoc.getLocation(pt, function(rs){
var addComp = rs.addressComponents;
var start_city=addComp.city;
var start_addr=addComp.city + addComp.district + addComp.street + addComp.streetNumber;
setCookie("start_city",start_city);
//setCookie("start_addr",start_addr);
if(getCookie("cityname")!=start_city&&getCookie("cityname")!=null){
if(confirm("检测到您的当前位置为"+start_city+"是否切换")){
jump_city(start_city);
}
}
加在"是否切换"后...应该怎么加呢? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询