随笔分类 -  JavaScript

摘要:需要的js1需要的js2这里主要用到Orientation属性。Orientation属性说明如下:旋转角度参数0°1顺时针90°6逆时针90°8180°3 图片上传 ... 阅读全文
posted @ 2015-11-27 13:54 Earic 编辑
摘要:你的问题原因是事件冒泡导致找不到或者找到多个事件导致的,你这样去写!$(“#div1").on("click",".k1",function(){ alert(11); })不要用:$(document).on("click","#div1 > .k1",function(){ ... 阅读全文
posted @ 2015-11-26 17:41 Earic 编辑
摘要:var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -... 阅读全文
posted @ 2015-11-26 09:26 Earic 编辑
摘要:1、正常方式$(function(){ wx.config({ debug: false, appId: '${appId}', timestamp:"${jsapi_timestamp}", ... 阅读全文
posted @ 2015-11-24 15:57 Earic 编辑
摘要:$("#show").removeAttr("style"); //ie,ff均支持 $("#show").attr("style",""); //ff支持,ie不支持 $("p:first").removeClass("intro"); 阅读全文
posted @ 2015-11-23 16:42 Earic 编辑
摘要:(function($) { $.extend({ myTime: { /** * 当前时间戳 * @return unix时间戳(秒) */ ... 阅读全文
posted @ 2015-11-23 13:55 Earic 编辑
摘要:网页可见区域宽: document.body.clientWidth网页可见区域高: document.body.clientHeight网页可见区域宽: document.body.offsetWidth (包括边线的宽)网页可见区域高: document.body.offsetHeight (包... 阅读全文
posted @ 2015-11-17 09:31 Earic 编辑
摘要:function obj2str(o){ var r = []; if(typeof o =="string") return "\""+o.replace(/([\'\"\\])/g,"\\$1").replace(/(\n)/g,"\... 阅读全文
posted @ 2015-11-03 18:35 Earic 编辑
摘要:WMI Scripting HTML 阅读全文
posted @ 2015-10-26 16:18 Earic 编辑
摘要:在body加入 onselectstart="return false" oncopy="return false;" oncut="return false;" 阅读全文
posted @ 2015-06-19 15:06 Earic 编辑
摘要:js输出对象类型: Object.prototype.toString.apply(s) 设置单行点击效果: obj.style.background = "#efefef";setTimeout(function() {obj.style.background = "";}, 100); js编码 阅读全文
posted @ 2014-05-22 15:31 Earic 编辑
摘要:JavaScript 本身可以算是一门简单的语言,但我们也不断用智慧和灵活的模式来改进它。昨天我们将这些模式应用到了 JavaScript 框架中,今天这些框架又驱动了我们的 Web 应用程序。很多新手开发者被各种强大的 JavaScript 框架吸引进来,但他们却忽略了框架身后浩如星海的 Jav... 阅读全文
posted @ 2013-10-14 16:05 Earic 编辑
摘要:function ClassA (sColor) { this.color = sColor; this.sayColor = function () { alert(this.color); }}function ClassB (sColor,sName) { this.ne... 阅读全文
posted @ 2013-06-05 11:37 Earic 编辑
摘要:Function.prototype.toString = function () { return "I wish everyone happy !"}function saySth () { alert("55555");}alert(saySth.toString());//I wis... 阅读全文
posted @ 2013-06-05 10:28 Earic 编辑
摘要:可以用prototype 属性为任何已有的类定义新方法。例:(判断某项在数组中的位置)Array.prototype.indexof = function (vItem) { for (var i=0; i < this.length; i++) { if (vItem == this[i]) {... 阅读全文
posted @ 2013-06-05 10:18 Earic 编辑