function get_address_gps_tx($map_key,$address){ //地址名称转座标 $r=file_get_contents('https://apis.map.qq.com/ws/geocoder/v1/?address='.$address.'&key='.$ma ...
分类:
Web程序 时间:
2020-11-11 15:45:09
阅读次数:
16
Promise是异步编程的一种解决方案,也是ES6的写法,它其实是一个构造函数,自己身上有all、reject、resolve这几个方法,原型上有then、catch等方法。 不多说,直接上代码: const promise = new promise(function(resolve, rejec ...
分类:
其他好文 时间:
2020-11-10 11:17:47
阅读次数:
7
<?php function bubble_sort(&$arr){ $count = count($arr); for($i=0;$i<$count-1;$i++){ for($j=$i+1;$j<$count;$j++){ if($arr[$j]<$arr[$i]){ $arr[$i] = $a ...
分类:
编程语言 时间:
2020-11-10 11:07:55
阅读次数:
9
原理:就是监听页面滚动事件,分析clientHeight、scrollTop、scrollHeight三者的属性关系。 window.addEventListener('scroll', function() { const clientHeight = document.documentEleme ...
分类:
Web程序 时间:
2020-11-10 11:04:36
阅读次数:
17
html代码 <a class="btn btn-primary fa fa-export" href="javascript:void(0);" onclick="expExcel()"><span>导出excel</span></a> js代码 function expExcel() { var ...
分类:
其他好文 时间:
2020-11-10 10:53:41
阅读次数:
4
开始我把 script 模块写到了 template 里面总是编译不通过。 第二点 template 里面可以写变量也可以写函数,写函数 script 里面就要写 /*methods:{ details: function(){ return this.site + "学的不是技术,更是梦想" ; ...
分类:
其他好文 时间:
2020-11-10 10:45:32
阅读次数:
3
1.表单数据 { field: 'mainSupervision', align: 'center', title: '监督要点', formatter: function (value, row, index) { var html = $.common.sprintf("<input oncli ...
分类:
其他好文 时间:
2020-11-10 10:38:33
阅读次数:
3
1. 背景: C++有不同的调用形式:函数指针、lambda表达式、有operator()的类对象等。 形式不同但调用方式却相同。为了能够统一,引入std::function和std::bind,来实现。 例子: // 普通函数 int add(int a, int b){return a+b;} ...
分类:
编程语言 时间:
2020-11-08 17:55:55
阅读次数:
33
1.大小写转换 str.toUpperCase() //都转为大写字母 str.toLowerCase() //都转位小写字母 2.获取子字符串 str.slice(start,end) //从start截取到end 特点: 1.包含start,不包含end 2.如果省略end,表示一直选取到尾 3 ...
前端异步方法 在进行前端操作时主要的异步操作有: 定时器操作 ajax异步操作 事件绑定 回调(不严谨) 在使使用定时器以及ajax异步操作时,返回值会显示为空。 下面看这个例子: function testNormal(){ var str = "是否会显示?" return str } func ...
分类:
其他好文 时间:
2020-11-07 17:48:09
阅读次数:
32