直接搜索地图

<input type="text" id='sn' class="b_input_1">

<input type="submit" class="b_input_2" id='mapsearch' value="  ">

document.getElementById('mapsearch').onclick = function(){

if(document.getElementById('sn').value == '请输入起点'){alert('请输入起点');return false;}

var s = "bt&c=289&sn=2$$$$$$" + encodeURIComponent(document.getElementById('sn').value) + "$$0$$$$&en=2$$$$$$" + encodeURIComponent('百度公司') + "$$0$$$$&ie=utf-8&oue=0";

var url = "http://map.baidu.com/?newmap=1&s=" + encodeURIComponent(s) + "&fr=alat0&from=alamap";

window.open(url);

};  

 

posted @ 2015-04-23 11:07  mrt_yy  阅读(200)  评论(0编辑  收藏  举报