Kagawa23's Blog

Just do it!


  • 首页

  • 归档

  • 标签

js:window.open被拦截问题和fetch方法缓存

发表于 2018-03-11 | 阅读次数
  1. window.open问题

问题的缘由是要打开新的网页,在鼠标点击时间里加了一段window.open的方法,由于这段点击时间还要访问另外一个api去取数据,所以导致了被浏览器拦截了。

因为还写了别的类似的按钮发现弹出代码出现在ajax或者是异步调用的内部时,马上出现被拦截的表现。

原因是浏览器检查到非用户的操作产生的新弹出窗口,会对其进行阻止,浏览器认为这个不是用户希望看到的页面,

解决方案:

  1. 使用a标签代替
    将标签可以换成a锚点来替代

  2. 先弹出窗口,再重定向

先通过用户打开页面,在对页面进行重定向

1
2
3
4
5
6
foo.addEventListener('click',function(){
var win = window.open('xxxx');
ajax().done(funciton(){
win.location.href = "taget url"
})
})

阅读全文 »

看房记

发表于 2018-03-03 | 分类于 看房 | 阅读次数

看房记

新年新气象,每周写一次博客吧。

这钱放在手里越来越毛,跟caicai商量着想来想去最稳妥的投资还是住宅不管是学区房还是商铺,先看起来吧。

听说前同事投资了一套学区房一问同事知道是竹园小学沪东校区,2号线转6号线过去瞅瞅。

竹园小学大概是浦东第二梯队的学校也是我们门口那个强多了。

阅读全文 »

使用 Dockerfile CMD 命令行重定向stderr输出

发表于 2017-05-20 | 阅读次数

项目需要,在docker image build阶段需要运行一个脚本,重定向bash脚本运行的输出,stderr重定向到stdout

shell命令行里很简单

1
bash script.sh 2>&1

在Dockerfile中直接定义

1
CMD ["bash","script.sh","2>&1"]

这样是没有办法工作的。

阅读全文 »

Django学习笔记(一)

发表于 2017-05-08 | 阅读次数

今天开始正式学习Django,奉上一张学习曲线
图片注释

阅读全文 »

JS继承

发表于 2017-04-14 | 分类于 前端 | 阅读次数

构造函数的继承

1
2
3
4
5
6
7
8
function Animal(){
this.species = "动物"
}
function Cat(name,color){
this.name = name;
this.color = color;
}
阅读全文 »

如何搭建hexo博客

发表于 2017-04-14 | 分类于 blog 博客 | 阅读次数

如何搭建hexo博客

1. 安装node

hexo博客需要安装nodejs

1
2
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
nvm install node-verison

2. 安装git

1
sudo yum install git

3. 安装博客框架

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo npm install hexo-cli -g
//hexo初始化一个博客
hexo init blog
cd blog
npm install
hexo server
//或者从github checkout项目
git clone
npm install
阅读全文 »

Hello World

发表于 2017-04-14 | 阅读次数

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

Kagawa23

Kagawa23

养成写字好习惯

7 日志
3 分类
5 标签
Github
© 2015 - 2018 Kagawa23
由 Hexo 强力驱动
主题 - NexT.Pisces