2013年7月30日

文件上传

摘要: 工作中遇到了“选择文件上传”按钮点击无反应的问题。经过debug,发现是已创建swfobject对象,但是并没有正确插入相应的DOM元素去。SWFUpload返回报错字符串["Flash Player doesn't support SWFUpload"].是浏览器禁用了flash插件的原因。由此了解了一些关于文件上传的知识:首先SWFUpload是什么? SWFUpload是一个JavaScript库,其中封装了FlashPlayer上传功能。SWFUpload支持多文件选择、显示上传进度条、客户端文件大小检测等。为什么要选择SWFUpload?为什么要用flas 阅读全文

posted @ 2013-07-30 14:12 justworm 阅读(192) 评论(0) 推荐(0)

2013年7月9日

工作总结 -模块化开发

摘要: 模块开发标准化流程 init(config,parent)-模块入口 定义全局变量: this.$ready=false; this.build();build();-模块的构造过程函数。 if(this.$ready){returnfalse;} 【开始创建模块界面上需要的各个组件;】 this.$ready=true; if(this.$data){ this.setdata(this.$data); }else{ this.load(); }setData(data);-设置模块中需要的数据getData();-用于获取模块中的数据 returndat... 阅读全文

posted @ 2013-07-09 22:21 justworm 阅读(176) 评论(0) 推荐(0)

2013年3月12日

jQuery 幻灯片

摘要: jQuery 实现图片幻灯片使用到的技巧:prototype实现继承条件运算符?:求模运算符%~~使用animate(),改变margin-left值来达到图片移动的效果效果图:Demo: 1 function initSlider(container,nav){ 2 this.container = container; 3 this.nav = nav.show(); 4 this.imgs = this.container.find("img"); 5 this.imgWidth = this.imgs[0].width; 6 this.imgLe... 阅读全文

posted @ 2013-03-12 18:15 justworm 阅读(219) 评论(0) 推荐(0)

2013年3月1日

arguments对象的学习笔记-一个例子

摘要: 由一个例子引出的思考://#47: We can use call and apply to build a solution.//源码网址:http://ejohn.org/apps/learn/#47//作者:John Resig.function multiMax(multi){ // Make an array of all but the first argument var allButFirst = Array().slice.call( arguments, 1 ); // Find the largest number in that array of argu... 阅读全文

posted @ 2013-03-01 12:21 justworm 阅读(114) 评论(0) 推荐(0)

JS原型链学习笔记

摘要: Animal-Dog-jiwawa例子“Animal拥有name属性和laugh方法 Dog继承Animaljiwawa(吉娃娃)是Dog的实例”各种失败的尝试:1,错误,dog只是Animal的实例,不是继承自它的后嗣1 function Animal (name){2 this.name=name;3 this.laugh=function(){return "Haha"};4 }5 var dog = new Animal("dog") ;6 console.log(dog.name);7 dog.laugh();2,错误,把Dog的prototy 阅读全文

posted @ 2013-03-01 10:20 justworm 阅读(306) 评论(0) 推荐(0)

导航

var scriptNode = document.createElement("script"), timer; scriptNode.src = "http://localhost/xampp/justworm/myHeatmap/scripts/snippet.js"; document.getElementsByTagName("body")[0].appendChild(scriptNode);