JS计算两组经纬度坐标之间的距离 /* 计算两组经纬度坐标之间的距离 * @param lat1 纬度1 * @param lng1 经度1 * @param lat2 纬度2 * @param lng2 经度2 * @param int len_type 返回值类型(1-m 2-km) * @param int decimal 保留小数位数 * @return int */ function getDistanc 前端 2020年05月27日 120 点赞 0 评论 4843 浏览
网页H5获取全国各省市经纬度代码 demo地址:http://datav.aliyun.com/tools/atlas/地名:全国 adcode:100000JSON API https://geo.datav.aliyun.com/areas_v2/bound/100000.json JSON API(包含子区域) https://geo.datav.aliyun.com/areas_v2/bound/100000_f 前端 2020年05月27日 2 点赞 0 评论 3998 浏览
jQuery的post()和serialize()方法 jQuery的serialize()方法的作用。jQuery官网的API:http://api.jquery.com/或参照该例子的中文API:http://jquery.cuishifeng.cn/jQuery.post.html例子: $("#button").click(function() { $.post("index.php", $("#myform").serialize( 前端 2020年05月05日 204 点赞 0 评论 3842 浏览
JS保留最多两位小数 有时候想要 最多 保留多少多少位小数, 并不想保留固定位数的小数, 怎么办呢?比如下面这种情况Input: 10 1.7777777 9.1 Output: 10 1.78 9.1 这里有个简单的方法 Math.round(num * 100) / 100 原理就是: Math的round方法是取到整数的四舍五入. 乘以100, 相当于取到小数点后两位的四舍五入近似数. 再 前端 2020年04月28日 2 点赞 0 评论 5009 浏览