location

window.location.href的用法

大兔子大兔子 提交于 2019-11-28 20:21:04
"window.location.href"、"location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.location.href"是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写 "window.location.href"、"location.href":D页面跳转 "parent.location.href":C页面跳转 "top.location.href":A页面跳转 如果D页面中有form的话, <form>: form提交后D页面跳转 <form target="_blank">: form提交后弹出新页面 <form target="_parent">: form提交后C页面跳转 <form target="_top"> : form提交后A页面跳转 关于页面刷新,D 页面中这样写: "parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); ) "top.location.reload();": A页面刷新 来源: oschina 链接: https:/

关于js中window.location.href,location.href,parent....

喜你入骨 提交于 2019-11-28 20:20:35
"window.location.href"、"location.href"是本页面跳转 "parent.location.href"是上一层页面跳转 "top.location.href"是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的iframe,如果D中js这样写 "window.location.href"、"location.href":D页面跳转 "parent.location.href":C页面跳转 "top.location.href":A页面跳转 如果D页面中有form的话, <form>: form提交后D页面跳转 <form target="_blank">: form提交后弹出新页面 <form target="_parent">: form提交后C页面跳转 <form target="_top"> : form提交后A页面跳转 关于页面刷新,D 页面中这样写: "parent.location.reload();": C页面刷新 (当然,也可以使用子窗口的 opener 对象来获得父窗口的对象:window.opener.document.location.reload(); ) "top.location.reload();": A页面刷新 来源: oschina 链接: https:/

How to simulate driving a route in real device

老子叫甜甜 提交于 2019-11-28 20:08:31
问题 I have a locations based app and I want to test it without real moving. I know I can provide a kml file of points but I don't want to use emulator, but real device. could you tell me what is the best way to simulate driving a route on the device? I emphasize that I need to simulate an entire route rather than a single point. thank you for giving your time 回答1: I'm using mock locations in the development of my app. The following two apps have proved reliable in mocking locations (static

Keep location service alive when the app is closed

好久不见. 提交于 2019-11-28 19:53:42
I have a service which sends a notification when the user changes his/her location. This service is working fine, but the problem arises when the user closes the app as the service closes too. How I can make the service still alive even though the application was closed? My Service is: public class LocationService extends Service implements LocationListener { public final static int MINUTE = 1000 * 60; boolean isGPSEnabled = false; boolean isNetworkEnabled = false; boolean canGetLocation = false; Location location; // location double latitude = 0; // latitude double longitude = 0; // longitude

Geofence API for iOS 5

人盡茶涼 提交于 2019-11-28 19:34:36
I want to build an application that can set up a set amount of geo-fenced square regions across town, I know I could achieve this by enabling location in the background, and check those coordinates to determine if they are in my area of interest. But that would mean receiving many notifications from the system and would hit the battery performance. Instead I wondered if there was a new API or possibly an upcoming one that would let you set a geo fence and only be notified by the system if you're inside of that or close by, rather then monitor your location constantly. Is that possible ? I

How to force a page to reload if all what was changed in url is hash?

家住魔仙堡 提交于 2019-11-28 19:08:12
I am trying to reload current page with different url hash, but it doesn't work as expected. (Clarification how I want it to work: Reload the page and then scroll to the new hash.) Approach #1: window.location.hash = "#" + newhash; Only scrolls to this anchor without reloading the page. Approach #2: window.location.hash = "#" + newhash; window.location.reload(true); Kinda works but it first scrolls to the anchor, then reloads the page, then scrolls to the anchor again. Approach #3: window.location.href = window.location.pathname + window.location.search + "&random=" + Math.round(Math.random()

Difference between document.URL and location.href

最后都变了- 提交于 2019-11-28 18:32:59
I know that document.URL can not be set, while location.href can. But the Document indicates: URL is a replacement for the DOM Level 0 location.href property. So when would we use document.URL ? rsplak You can get the document.URL, but you can not set it. You can both get and set the location.href . In some webbrowsers, you are able to set the document.URL but please don't, as it doesn't work in most browsers. You gave the answer yourself! var currentURL = document.URL; alert(currentURL); Learn more here They're interchangeable as far as getting data is concerned, but as you pointed out

Excessive Alarm Manager wakeups in android with Google Play Services Location

吃可爱长大的小学妹 提交于 2019-11-28 18:17:36
I received an performance report from Android Vital on Google Play Console about Excessive Alarm Manager wakeups: https://developer.android.com/topic/performance/vitals/wakeup.html I use Location API from Google Play Services to request for location updates in the background. On the report it show that the excessive wake up wakeups was caused by com.google.android.location.ALARM_WAKEUP_LOCATOR from LocationListener. Below the code snippet which causes the alarms: private synchronized void buildGoogleApiClient() { mGoogleApiClient = new GoogleApiClient.Builder(context) .addConnectionCallbacks

Accuracy of Core Location

偶尔善良 提交于 2019-11-28 17:58:03
问题 I'm currently working on a location tracking app and I have difficulties with inaccurate location updates from my CLLocationManager . This causes my app to track distance which is in fact only caused by inaccurate GPS readings. I can even leave my iPhone on the table with my app turned on and in few minutes my app tracks hundreds of meters worth of distance just because of this flaw. Here's my initialization code: - (void)initializeTracking { self.locationManager = [[CLLocationManager alloc]

漏洞挖掘技巧之利用javascript:

江枫思渺然 提交于 2019-11-28 17:33:32
  好久没更新博客了,更新一波。     场景:       window.location.href=””   location=””   location.href=””   window.location.*    常见地点:任何二次跳转处 可能存在问题的参数:*_url ,url_*,url 危害:跳转和xss      首选xss 最简单的: 伪协议 ,以location为例子 location=”javascript:alert(1) ” location=”javascript:alert(1) ” 利用伪协议2: location=”data:html;base64,PHNjcmlwdD5hbGVydCgxKTwvc2NyaXB0Pg” base64编码可以不要== 漏洞挖掘发现每次都过滤javascript:(这里不探讨过滤了alert怎么绕过。) 一系列绕过思路: \x JS十六进制 javascript: -> \x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x3a location="\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x3aalert(1)" \u Unicode编码 javascript:-> \u006A\u0061\u0076\u0061\u0073\u0063