location

location.href 与 location.hash

不想你离开。 提交于 2020-03-03 05:25:20
this.hash 获取或设置标签值(jquery) (2015-03-03 15:34:13) 转载 ▼ 标签: this.hash jquery 使用出处: this.hash含义: location是javascript里边管理地址栏的内置对象,比如location.href就管理页面的url,用location.href=url就可以直接将页面重定向url。而location.hash则可以用来获取或设置页面的标签值,也就是锚链接的值。比如 http://domain/#admin 的location.hash="#admin"。 this.hash:获取当前链接的标签值: location.hash 综:window. location.href 表示 重定向 ,后面跟着的是完整的 url地址 ,与其相似的还有window. location.hash , 下面来比较window.location.href和window.loc ai ton.hash的区别。 (1) window.location.href 得到和使用的是完整的url,比如window.location.href="w ww.baidu.com ”表示的是重新定向,页面跳转 到新的页面。也可以通过window.location.href得到a标签的完整的href,比如<a href="#book"

nginx 配置vue代理2种方式

房东的猫 提交于 2020-03-03 05:07:35
**方法一** 访问方式:http://域名 server { listen 8088; #端口号,自定义 server_name 域名; root 路径; index index.html; # Load configuration files for the default server block. location / { try_files $uri $uri/ @router; index index.html index.htm index.php; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' 'GET'; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } location @router { rewrite ^.*$ /index.html last; } location /api/ { #vue前端所有接口都加上/api/前缀

org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request;

六眼飞鱼酱① 提交于 2020-03-03 04:53:15
此篇文章摘自: https://funyan.cn/p/298.html 最近做项目,在处理上传文件这一块突然出现错误,百思不得其解,查了很多资料才知道是上传的临时文件目录失效了,错误如下: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1337767218595042057.80/work/Tomcat/localhost/ROOT] is not valid org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest (StandardMultipartHttpServletRequest.java:112) org.springframework.web.multipart.support.StandardMultipartHttpServletRequest. 产生原因: 在linux系统中,springboot应用服务再启动(java

获得控件坐标

主宰稳场 提交于 2020-03-02 11:04:24
三种方法: getLocationOnScreen(location):获得在屏幕上的坐标(包括通知栏) getLocationInWindow(location):获得在该窗口的坐标 getTop()、getLeft()、getBottom()、getRight()获得在父窗口中的位置 注意:在获得控件的宽高时,不能放在onCreate()中,在该方法中,是无法获得控件的宽高和坐标的,应在生命周期中的 onWindowFocusChanged(boolean hasFocus)方法中实现 以下代码仅供测试: import android.app.Activity; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.RelativeLayout.LayoutParams; import android.widget.TextView; public class TestActivity extends Activity { private ImageView img; private

window.location 与window.open的区别

时间秒杀一切 提交于 2020-03-02 04:35:53
window.open默认在新窗口中打开 加入target属性(_blank)后,浏览器默认在新标签页中打开 window.open(url,"_blank"); 1.window.location是window对象的属性,而window.open是window对象的方法 window.location是你对当前浏览器窗口的URL地址对象的参考! window.open是用来打开一个新窗口的函数! 2.window.open不一定是打开一个新窗口!!!!!!!! 只要有窗口的名称和window.open中第二个参数中的一样就会将这个窗口替换,用这个特性的话可以在iframe和frame中来代替location.href。 如<iframe name="aa"></iframe> <input type=button onclick="window.open('1.htm','aa','')">和 <input type=button onclick="self.frames['aa'].location.href='1.htm'">的效果一样 3. 在给按钮、表格、单元格、下拉列表和DIV等做链接时一般都要用Javascript来完成,和做普通链接一样,可能我们需要让链接页面在当前窗口打开,也可能需要在新窗口打开,这时我们就可以使用下面两项之一来完成: window.open

window.location 与window.open区别

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-02 04:29:30
1.window.location是window对象的属性,而window.open是window对象的方法 window.location是你对当前浏览器窗口的URL地址对象的参考! window.open是用来打开一个新窗口的函数! 2.window.open不一定是打开一个新窗口!!!!!!!! 只要有窗口的名称和window.open中第二个参数中的一样就会将这个窗口替换,用这个特性的话可以在iframe和frame中来代替location.href。 如<iframe name="aa"></iframe> <input type=button onclick="window.open('1.htm','aa','')">和 <input type=button onclick="self.frames['aa'].location.href='1.htm'">的效果一样 3. 在给按钮、表格、单元格、下拉列表和DIV等做链接时一般都要用Javascript来完成,和做普通链接一样,可能我们需要让链接页面在当前窗口打开,也可能需要在新窗口打开,这时我们就可以使用下面两项之一来完成: window.open 用来打开新窗口 window.location 用来替换当前页,也就是重新定位当前页 可以用以下来个实例来测试一下。 <input type="button"

nginx 之proxy_pass

人走茶凉 提交于 2020-03-01 19:42:56
在nginx中配置proxy_pass代理转发时,如果在proxy_pass后面加不加路径是有很大区别的,具体情况我们来做几个测试 proxy_pass 后面不带路径 location /test { proxy_pass http://192.168.1.8; } View Code 访问http://www.kzf.com/test/... 代理转发后URL为http://192.168.1.8/test/..。实际转发后用代理的地址+客户端的uri 来转发的。 proxy_pass 后面加“/” location /test { proxy_pass http://192.168.1.8/; } View Code 访问http://www.kzf.com/test/a.html 代理转发后URL为http://192.168.1.8//a.html。多了一个/,是因为去掉了location中的路径/test,然奇一proxy中的/作为根路径+客户端URI中去掉/test的部分。去掉的是location 中的uri 而不是客户端请求中的uri,例如客户端请求为http://www.kzf.com/test/asdf/a.html 那么转发后的请求的uri 为//asdf/a.html 而不是/a.html。 proxy_pass 后面是一个非根路径 location

Nginx location 配置踩坑过程分享

梦想与她 提交于 2020-03-01 16:25:12
这是五个小时与一个字符的战斗 是的,作为一个程序员,你往往发现,有的时候你花费了数小时,数天,甚至数星期来查找问题,但最终可能只花费了数秒,改动了数行,甚至几个字符就解决了问题。这次给大家分享一个困扰了我很久,我花了五个小时才查找出问题原因,最终只添加了一个字符解决了的问题。 问题描述 我们的业务系统比较复杂,但最终提供给用户的访问接口比较单一,都是使用 Nginx 来做一个代理转发,而这个代理转发,往往需要匹配很多种不同类型的 URL 转给不同的服务。这就使得我们的 Nginx 配置文件变得很复杂,粗略估计了下,我们有近20个 upstream,有近60个 location 匹配。这些配置按照模块分布在不同的文件中,虽然复杂,但是仍然在我们的努力下运行的良好。直到有一天,有位同事给我反映说偶尔有些 URL 会出现 404 的问题。一开始没太在意,因为他也说不准是哪一种 URL 才遇到这个问题。 问题查找 后来,慢慢的查找,找到了一些规律,一开始只知道是 tomcat 那边返回 404了,想到 Nginx 都代理给了 tomcat,一开始就怀疑是程序的问题,不会想到是 Nginx。 我开始查找代码的问题,我在本地的开发环境,尝试了很久,我使用 8080 端口访问,不论如何都是正确的结果,可是生产环境就是不行。然后我就听信了某坑友同事的理论,重启解决 95% 的问题,重装解决 100

objective-c 定位导航

此生再无相见时 提交于 2020-03-01 13:07:52
ViewController.m 文件 #import "ViewController.h" // 引入核心定位 #import <CoreLocation/CoreLocation.h> // 地图 #import <MapKit/MapKit.h> // 引入大头针 #import "Annotation.h" //NSLocationWhenInUseUsageDescription-->YES (当使用) //NSLocationAlwaysUseUsageDescription-->YES (一直) @interface ViewController ()< CLLocationManagerDelegate , MKMapViewDelegate > { // 创建管理者 CLLocationManager * locationManager; // 定义地图 MKMapView * mapViewWO; UITextView * textview; // 创建地理编码对象 CLGeocoder * geoCoder; } @end @implementation ViewController - ( void )viewDidLoad { [ super viewDidLoad ]; [ self layout ]; geoCoder =[ CLGeocoder

BOM介绍以及方法

血红的双手。 提交于 2020-02-29 03:37:49
BOM介绍和window对象的方法 一、BOM对象 (浏览器对象模型 BOM) 1、window alert() confirm() prompt() setInterval() ​ setTimeout() 2、location ​ herf ​ hash ​ url ​ ... 3、screen 4、history ​ go() 二、window方法 1、alert() 1 alert('派大星'); 2、confirm() 1 var a = window.confirm('你确定要离开网站吗?'); 2 console.log(a); 3、prompt() 1 var name = window.prompt('今天吃了什么?','海绵宝宝'); 2 //前面是输入,后面是默认 3 console.log(name); 定时器方法 一、setTimeout() 延迟性操作 1 window.setTimeout(function(){ 2 console.log('派大星');//延迟了4秒 3 },4000); 4 console.log('海绵宝宝'); 5 6 //定时器 异步运行 7 function hello(){ 8 alert("hello"); 9 } 10 11 var t1 = window.setTimeout(hello,1000);/