location

如何捕捉窗口的前进、后退、刷新、停止、关闭、移动事件

删除回忆录丶 提交于 2020-01-26 21:50:08
停止有document.onstop,看微软的例子 <body scroll=no> <script> document.onstop=fnTrapStop; var oInterval; window.onload=fnInit; function fnInit(){ oInterval=window.setInterval("fnCycle()",1); } function fnCycle(){ // Do something } function fnTrapStop(){ window.clearInterval(oInterval); alert(); } </script> </body> ___________________________________________________________________________________________ 刷新与关闭 <body scroll=no> <script> document.body.onbeforeunload=aa; function aa(){ if(event.clientY<0&&event.clientX>760||event.altKey) alert("窗口关闭!") else alert("窗口刷新!") } </script> </body> //写死了宽度

Nginx学习之--配置文件

不打扰是莪最后的温柔 提交于 2020-01-26 09:41:35
一、配置文件理解 # 编辑配置文件 vi /usr/local/nginx/conf/nginx.conf # 只看未注释的 # 代表并发处理的数量,值越大并发越大,只要设备支持 worker_processes 1; # nginx服务器和用户网络连接 events { # 代表 worker_processes 最大连接数 worker_connections 1024; } # 大部分修改都在这里,代理、缓存、日志等等(注释掉的我这里删除了) http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { # nginx监听端口号 listen 80; # 主机名称 server_name localhost; # 当路径包含某个值时进行的操作 location / { root html; index index.html index.htm; } # 错误页面 error_page 500 502 503 504 /50x.html; # 当路径包含某个值时进行的操作 location = /50x.html { root html; } } } 二、反向代理 # 1、安装tomcat和jdk并配置 # 2

子窗口刷新父窗口然后关闭

試著忘記壹切 提交于 2020-01-26 00:44:56
页面a里有个按钮点上就用window.showModalDialog(“b.html”)打开页面b.html这个页面里有个提交form点提交以后,就在父页A里增加一条记录,算新父目录然后父目录里能看见新增加的记录,关闭子页面,怎么实现,好像就是子窗口刷新父窗口然后关闭 1 history.go(0) 2 location.reload() 3 location=location 4 location.assign(location) 5 document.execCommand('Refresh') 6 window.navigate(location) 7 location.replace(location) 8 document.URL=location.href 这几个都可以刷新 比如:父窗口 <a href="javascript:void(0)" onclick="window.open('child.html','child','width=400,height=300,left=200,top=200');">打开子窗口</a> 子窗口 <script language="JavaScript" type="text/javascript"> <!-- function refreshParent() { window.opener.location.href =

GetLastLocation always returns null

南笙酒味 提交于 2020-01-25 10:30:29
问题 I try to access the last known location in a Fragment as explained here in my onCreate: public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mGoogleApiClient = new GoogleApiClient.Builder(getActivity()) .addConnectionCallbacks(this) .addOnConnectionFailedListener(this) .addApi(LocationServices.API) .build(); } in my onResume: @Override public void onResume() { super.onResume(); mGoogleApiClient.connect(); } The Fragment implements GoogleApiClient

How to ask for location permission in Android Studio?

夙愿已清 提交于 2020-01-24 17:08:11
问题 I have tried so many codes and solutions but none of them worked. I want to ask the user for permission and get the pop-up window. Even though I used the code the window won't show? I think the code can get changed but I don't know exactly where to place it. Also, I'm new to Android Studio public class MainActivity extends AppCompatActivity implements OnMapReadyCallback { private GoogleMap mMap; private LatLngBounds PODGORICA = new LatLngBounds( new LatLng(42.400334, 19.227705), new LatLng(42

How to Fix: Cannot assign value of type 'CLLocationDegrees' (aka 'Double') to type 'Float!' in Swift 3

人走茶凉 提交于 2020-01-24 09:48:26
问题 I get a coordinate from my google map and I want to assign it to a float variable, but it shows this error: Cannot assign value of type 'CLLocationDegrees' (aka 'Double') to type 'Float!' func markerButtonClicked(sender:MapButton) { let coord = self.getCenterCoordinate() let addressObj = Address() addressObj.latitude = coord.latitude addressObj.longitude = coord.longitude } func getCenterCoordinate() -> (CLLocationCoordinate2D) { let location = CGPoint(x:self.mView.bounds.size.width/2,y:self

Android Fused Location Won't Deliver Periodic Updates

三世轮回 提交于 2020-01-24 09:45:30
问题 I want to get a hard location fix every certain minutes & a soft location fix every certain minutes and if user has moved more then certain meters. I been testing the logic with following piece of code walking (tried it with larger parameters as well while driving) but it doesn't really return me periodic location fixes. It would return a location fix right away when request starts then sometime return 1 location fix few minutes later that but then for up-to an hour it won't return a location

转:获取网页URL地址及参数等的两种方法(js和C#)

孤者浪人 提交于 2020-01-24 07:27:36
转:获取网页URL地址及参数等的两种方法(js和C#) 一 js 先看一个示例 用javascript获取url网址信息 <script type="text/javascript"> document.write("location.host="+location.host+"<br>"); document.write("location.hostname="+location.hostname+"<br>"); document.write("location.href="+location.href+"<br>"); document.write("location.pathname="+location.pathname+"<br>"); document.write("location.protocol="+location.protocol+"<br>"); </script> 执行 用javascript获取url网址信息 代码效果如下 location.host= www.vnde.cn location.hostname= www.vnde.cn location.href= http://www.vnde.cn/bc/2008/0306/article_1860.html location.pathname= /bc/2008/0306/article

小例子-使用JS/JQ获取a标签的href网址

放肆的年华 提交于 2020-01-23 23:35:53
最初的想法只是想要添加一个点击事件就可以跳到设定的窗口。 本身就是把window.location.href = href添加进事件里面就可以解决了。后面自己把自己搞糊涂了。 这里主要是说使用JS和JQ获取a标签的href网址,使用比较简单,基本就是拿来用就可以了。 先看看html部分的代码 <div> <a id="demo" href="https://www.baidu.com"></a> </div> <p id="p">点击跳转到百度</p> 我把a标签嵌套在div里面,之后通过点击事件点击p标签“跳转到百度”这个按钮来获取href,之后通过新窗口打开百度网址,进入百度。 以下是使用到的JS代码和JQ代码 // 使用Js获取 document.querySelector('#p').onclick = function () { var ahref = document.querySelector('#demo'); window.open(ahref);//在新窗口打开 window.location.href = ahref;//在原来窗口打开 } // 使用JQ获取 $('#p').click(function () { var hreF = $(this).prev().find('#demo').attr('href'); window.open(hreF);/

Convert the coordinates of a shapefile in Geopandas

江枫思渺然 提交于 2020-01-23 17:40:26
问题 I am new at spatial analysis, but I cant find this answer anywhere. I have a list of post codes in CRS coordinates, latitude and longitude, and London's Boroughs shape file in OSN coordinates, and I would like to map them together, but this is what happens. This is the head of the postcodes london_post_codes.head() Out[81]: postcode latitude longitude 0 WD6 1GS 51.658021 -0.255663 1 WD17 1LA 51.660366 -0.397525 2 WC2N 6LE 51.509413 -0.121676 3 WC2N 6NA 51.508363 -0.124454 4 WC2N 6ND 51.508216