摘要: ajax 是一种请求服务器的方式,核心是XMLHttpRequest对象;优点是无需刷新页面,缺点是不能跨域请求。/* * Ajax direacted by Zakas * * Ajax.get("url?p=value", function (data) { // handle data },... 阅读全文
posted @ 2014-06-11 18:09 farawayfromhome 阅读(553) 评论(0) 推荐(0) 编辑
摘要: 链接的虚线框问题/* * a, img, input等标签点击时会带有虚线框 * 去除它*/.noDashedBox { outline:0; blur:expression(this.onFocus=this.blur());}固定定位/* css */.fixedTop { ... 阅读全文
posted @ 2014-06-10 17:54 farawayfromhome 阅读(433) 评论(0) 推荐(0) 编辑
摘要: IE8以下请求助神之Douglas Crockford:https://github.com/douglascrockford/json-jsJSON是一种格式化的字符串,特别适合在网络上传输,由Douglas Crockford发明。JSON语法可以表示三种类型的值: 简单值:字符串、数值、布尔值... 阅读全文
posted @ 2014-06-06 19:06 farawayfromhome 阅读(328) 评论(0) 推荐(0) 编辑
摘要: A FORM textbox with maxlength reset submit表单的elements属性// 获取表单元素var form = document.getElementById("form");//... 阅读全文
posted @ 2014-06-06 17:03 farawayfromhome 阅读(421) 评论(0) 推荐(0) 编辑
摘要: 大神之字符与字符实体的相互转换方法// & to &if (!String.prototype.entityify) { String.prototype.entityify = function () { return this.replace(/&/g, "&... 阅读全文
posted @ 2014-06-05 23:00 farawayfromhome 阅读(416) 评论(0) 推荐(0) 编辑
摘要: // 微信分享到朋友圈的内容和图片的定制(function () { // data for weixin var dataForWeixin = { appId: "wx4654ffed0376f250", // ttfund app id imgUrl:... 阅读全文
posted @ 2014-06-05 19:11 farawayfromhome 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 检测设备、微信平台和app是否安装 // 检测是否安装了APPvar isappinstalled = (function () { return (location.search.indexOf("isappinstalled=1") !== -1); }()), ... 阅读全文
posted @ 2014-06-05 18:12 farawayfromhome 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 示例用法 tinyCss--my css study tidy 提示一:viewport, 当你的页面有宽度时,比如宽度为10... 阅读全文
posted @ 2014-06-05 14:17 farawayfromhome 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 简单的通用事件方法var EventUtil = { getEvent: function (e) { return e || window.event; }, getTarget: function (e) { return e.target || e... 阅读全文
posted @ 2014-05-30 19:09 farawayfromhome 阅读(483) 评论(0) 推荐(2) 编辑
摘要: 1、偏移量// 元素相对于文档的偏移量var getOffSet = function (ele) { var actualLeft = ele.offsetLeft, // 相对于offsetParent元素的左位移 actualTop = ele.offsetTop, ... 阅读全文
posted @ 2014-05-29 18:15 farawayfromhome 阅读(320) 评论(1) 推荐(0) 编辑