2016 年文章归档
共 6 篇文章
jquery--获取链接参数
function getQueryString(url) { var obj = {}; var reg=/([^?&=]+)=([^?&=]+)/g; url.replace(reg,function(){ obj[arguments[1]]=decodeURIComponent(arguments[2]); }); return obj; } var obj_fri = getQueryString(decodeURIComponent("http://huosu.com?data1=data1&data2=data2")); console.log(obj_fri);//Object …
2016-07-26 17:47 · JavaScript
HTML5+javascript 动画基础(阅读笔记)
1.1.使用requestAnimationFrame的动画循环 (function drawFrame () { window.requestAnimationFrame(drawFrame,canvas); //animation code... }()); 1.2交互事件 1.2.1 鼠标常见的一些事件: ● mousedown ● mouseup ● click ● dblclick ● mousewheel ● mousemove ● mouseover ● mouseout 1.2.2 触摸事件 ● touchstart ● touchend ● touchmove 1.3 获取…
2016-06-30 13:28 · canvas
ajax
Ajax XMLHttpRequest 对象 var xhr; if(window.XMLHttpRequest){ //code for IE7+,firfox,chrome,opera,safari xhr = new XMLHttpResquest(); }else { //code for IE6,IE5 xhr = new ActiveXObject("Microsoft.XMLHTTP"); } 向服务器发送GET请求 xhr.open("GET","test1.php?t="+Math.random(),true);//true异步进行/false同步进行 xhr.send()…
2016-06-13 16:12 · JavaScript
javascript------this
this JavaScript的this总是指向一个对象,而具体指向哪个对象是在运行时基于函数的执行环境动态绑定的,而非函数被声明时的环境。 1 this的指向 除去不常用的with和eval的情况,具体到实际应用中,this的指向大概分为以下4种: ●作为对象的方法调用。 ●作为普通函数调用。 ●构造器调用。 ●Function.prototype.call或Function.prototype.apply调用。 1.1 作为对象的方法调用 当函数作为对象的方法被调用时,this指向该对象: var obj = { a : 1, getA : function(){ console.log…
2016-06-13 15:16 · JavaScript
javascript对象
1.语法 1.1对象的定义:声明(文字)形式和构造形式。 对象的文字语法: var myObj = { key:value } 对象的构造形式定义 var myObj = new Object(); myObj.key = value; 1.2对象的类型 在JavaScript中一共有6种主要的类型(*string,*number,*boolean,*null,*undefind,*object) JavaScript中有许多特殊的对象子类型,通常被称为内置对象(*string,*number,*boolean,*object,*Function,*Array,*Date,*RegExp,*…
2016-06-12 13:33 · JavaScript
总结一些每次写都要百度的样式 and so on
本次总结无关乎顺序,想到什么查什么总结什么(希望这次总结都能记住记住记住) :wink: 1.css溢出显示... { overflow:hidden; text-overflow:ellipsis; } 2.table边框合并,显示单线框 table{ border-collapse: collapse; } table tr td,table tr th{ border:1px solid #e2e2e2; } 3.ajax获取后台数据(引入jQuery) $.ajax({ type: "get", data:{ act:"getcount", ... }, async: false, …
2016-06-03 14:00 · 基础学习