-
国内双核浏览器兼容模式和极速模式
-
使用greasemonkey自动取消支付宝登录控件勾选
源代码在这里。 支付宝登录的安全控件默认是勾选的,如果想要取消默认勾选,可以使用greasemonkey模拟点击安全控件。但是支付宝首页的登录页面实际上是一个异步加载的iframe,稍微有点麻烦。带注释的源代码如下: // 绑定事件 window.onload = function() { var counter = 0; var waitForOption = setInterval(function(){ // 如果取消勾选成功或者连续5次失败,不再尝试 if(uncheckSafeLoginOption() || counter++ > 5) { clearInterval(waitForOption); } }, 1000); } function uncheckSafeLoginOption() { var id = ‘safeSignCheck’; // 单独的登录页面直接查找元素 // 首页需要查找iframe后再查找元素 var safeLoginOption = document.getElementById(id) || getFrameDocument(‘loginIframe’).getElementById(id); if(safeLoginOption) { if(safeLoginOption.checked) safeLoginOption.click(); return true; } return false;…
-
從vanilla-js開始
-
nodeJs note 1
-
IE10 bug hack: box-shadow remains if box size changed
-
关于rel=”nofollow”
Google在Webmaster Tools页面提到: “Nofollow” provides a way for webmasters to tell search engines “Don’t follow links on this page” or “Don’t follow this specific link.” What are Google’s policies and some specific examples of nofollow usage? Untrusted content Paid links Crawl prioritization However, a solid information architecture — intuitive navigation, user- and search-engine-friendly URLs, and so…
-
读书笔记 – 高性能网站建设进阶指南(2)简化CSS选择符
css selectors 性能消耗从低到高: ID selectors #modal { overflow: hidden; } class selectors .container { margin: 0 atuo; } type selectors a { color: #999; } adjacent sibling selectors input + label { display: inline; } child selectors label > input { display: none; } descendant selectors .foo a { text-decoration: none; } universal selectors *…
-
读书笔记 – 高性能网站建设进阶指南(1)图像优化
-
跨系统跨浏览器的“微软雅黑”
这个问题起源于设计要求某页面在任何装了微软雅黑的系统里都要显示微软雅黑。这就包括,win下所有浏览器和mac下所有浏览器(我想没人会在linux下装雅黑的吧~)。 给font-family设定中文字体一般有两种常见方式:1、字体英文名,2、unicode。 我一直采用unicode的方法。 因为写成“Microsoft Yahei”的话,win下ff(曾经)和opera(目前为止)都不能正确识别。 写成unicode的话,win下所有浏览器都能显示雅黑字体。 但是这招在mac os下似乎行不通。 通过调试,基本确定mac下的雅黑的名字默认就是“Microsof Yahei”,不存在“微软雅黑”这个字体名。 所以mac os下写unicode是没法被识别成“微软雅黑”的。 但这样会造成win下部分浏览器没法正确显示雅黑。 终上, 如果想让win下全浏览器显示雅黑的话,font-family用unicode“\5FAE\8F6F\96C5\9ED1”; 如果想让全部装了雅黑的系统下的浏览器显示雅黑的话,font-family用英文名“Microsoft Yahei”, 但这意味着部分win下的浏览器无法正确显示雅黑。