element上绑定的scroll事件不冒泡;document上的会泡面。
要注意触发scroll事件的真正target是什么
body的height:100%,在window.document.body.addEventListner(‘scroll’)不生效,是因为body的高度和文档的高度一致了,不会触发滚动。但是如果去掉这个100%或者改用window.addEventListner(‘scroll’),就会生效
占坑,未完待续
心有猛虎 细嗅蔷薇
element上绑定的scroll事件不冒泡;document上的会泡面。
要注意触发scroll事件的真正target是什么
body的height:100%,在window.document.body.addEventListner(‘scroll’)不生效,是因为body的高度和文档的高度一致了,不会触发滚动。但是如果去掉这个100%或者改用window.addEventListner(‘scroll’),就会生效
占坑,未完待续
WordPress迁移
这两天趁着开工工作量不大,终于把Linode上的两个WordPress迁移到Vultur上了,删掉了Linode节点。想来也是人比较懒,不然也不会拖着这么久。
距上一次写博文已经过了三年多了,忙还真的只是借口罢了。
没想到wp的迁移插件(All-in-One WP Migration)还真的挺好用,下载两次,上传两次就搞定了。唯一需要注意的是要修改php和nginx的上传限制
自从某次网站挂了重启之后,搭建的shadowsocks再也没能用过。。。搞了好久都不行,总以为密码或者linode哪里出了问题。然后忍者肉痛买了digitalocean,过不久又抽风了,然后从旧金山貌似迁移到纽约3节点,还是有点断断续续的,然后偶然发现了vultr,东京节点速度很快也很稳定,但是用站长之家测试ping值linode还是比vultr快点的。
vultr就当个shadowsocks的服务器好了。。。
这两天还是想把linode的shadowsocks这挺好,突然发现貌似一直没有启动shadowsocks的服务。。。sigh~蠢了这么久,哎
参考链接:
// The actual grunt server settings connect: { options: { port: 9000, livereload: 35729, // Change this to '0.0.0.0' to access the server from outside // hostname: 'localhost' hostname: '0.0.0.0' }, // proxy配置 proxies: [{ context: '/cortex', host: '0.0.0.0', port: 80, https: false }], // proxy server: { options: { open: 'http://localhost', base: [ '<%= yeoman.dist %>', '<%= yeoman.tmp %>', '<%= yeoman.app %>' ], middleware: function (connect, options, middlewares) { middlewares.push( function (req, res, next) { var fs = require('fs'); var path = require('path'); var mimeType = { "css": "text/css", "gif": "image/gif", "html": "text/html", "ico": "image/x-icon", "jpeg": "image/jpeg", "jpg": "image/jpeg", "js": "text/javascript", "json": "application/json", "pdf": "application/pdf", "png": "image/png", "svg": "image/svg+xml", "swf": "application/x-shockwave-flash", "tiff": "image/tiff", "txt": "text/plain", "wav": "audio/x-wav", "wma": "audio/x-ms-wma", "wmv": "video/x-ms-wmv", "xml": "text/xml" }; // just redirect static files to local workspace if (!/\.(js|html|css|png)/g.test(req.url)) { next(); return; } var pathname = req._parsedUrl.pathname; var ext = path.extname(pathname); ext = ext ? ext.slice(1) : 'unknown'; var contentType = mimeType[ext] || "text/plain"; pathname = path.resolve(process.cwd(), '.') + pathname; fs.exists(pathname, function (exists) { if (!exists) { res.writeHead(404, { 'Content-Type': 'text/plain' }); res.write("This request URL " + pathname + " was not found on this server."); res.end(); } else { fs.readFile(pathname, "binary", function (err, file) { if (err) { res.writeHead(500, { 'Content-Type': 'text/plain' }); res.end(err); } else { res.writeHead(200, { 'Content-Type': contentType }); res.write(file, "binary"); res.end(); } }); } }); } ); // Setup the proxy middlewares.push(require('grunt-connect-proxy/lib/utils').proxyRequest); return middlewares; } } } } // other code grunt.registerTask('serve', function (target) { grunt.task.run([ 'clean:dist', 'less', 'stylus', 'configureProxies:server', 'connect:server', 'watch' ]); });
高版本浏览器在服务器重定向时会带上原始链接中的hash值,某些低版本浏览器如IE9,则只会带上重定向时location中的hash值。因此对于单页面应用,某些情况下会出错。如对于nginx重定向http到https这种场景,如果location中没有带上原始数据的hash值,则就会有问题。
参考链接:
在原有LAMP结构的基础上,增加Nginx转发。主要工作如下:
点击参考链接查看更多内容
部分软件和操作可以通过VPN翻墙的方式弄好。
同类文章:http://www.zotob.org/1.html