摘要: 地址:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/assign 阅读全文
posted @ 2016-12-24 11:32 fireporsche 阅读(124) 评论(0) 推荐(0) 编辑
摘要: //条件表达式的四种表示方法: 1、三元运算符,this.props.name?this.props.name:"hello world"; 2、使用一个函数,里面可以使用if else语句,然后再用一个变量来获取返回的值,直接使用该变量就行; getName:function(){ if(this 阅读全文
posted @ 2016-12-23 22:54 fireporsche 阅读(185) 评论(0) 推荐(0) 编辑
摘要: index.htm?参数1=数值1&参数2=数值2&参数3=数据3&参数4=数值4&...... 静态html文件js读取url参数 根据获取html的参数值控制html页面输出 一、字符串分割分析法。 这里是一个获取URL带QUESTRING参数的JAVASCRIPT客户端解决方案,相当于asp的 阅读全文
posted @ 2016-12-22 22:44 fireporsche 阅读(8571) 评论(0) 推荐(1) 编辑
摘要: function createXHR(){ var xhr = null; if(window.XMLHttpRequest){//判断当前浏览器是否支持XMLHttpRequest xhr = new XMLHttpRequest(); }else if(window.XMLHttpRequest 阅读全文
posted @ 2016-12-21 22:34 fireporsche 阅读(1327) 评论(0) 推荐(0) 编辑
摘要: (function() { //加载 varobj = {}; /** * 动态加载脚本函数 * @param url 要加载的脚本路径 * @param callback 回调函数 */ obj.loadScript =function(url,callback){ var doc = docum 阅读全文
posted @ 2016-12-20 20:10 fireporsche 阅读(5383) 评论(1) 推荐(0) 编辑
摘要: var btn3 = document.getElementById("btn"); function event(){} var eventUtil = { //添加句柄 addHandler:function(element,type,handler){//element表示的是哪个元素,typ 阅读全文
posted @ 2016-12-18 23:33 fireporsche 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 1、字符串方法: charAt(index):返回指定位置的字符(下标为index,下标是从0开始的)。 indexOf(subString,[index]):返回字符串subString出现在字符串中的位置,如果没有找到就返回-1,其中[index]是可选参数,表示是从哪个下标开始查找,如果没有设 阅读全文
posted @ 2016-12-17 00:09 fireporsche 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 1、父级元素设置为relative,子元素设置为absolute,这样子元素同样处于标准流中,且子元素可以相对于父级元素来进行定位 比如:大的div content中有两个div content1和content2,通常contnet2是在content1下面的,如果我们想让content1和con 阅读全文
posted @ 2016-12-16 17:00 fireporsche 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1、当元素或者是它的包裹层设置了绝对定位或者是浮动,那么margin:0 auto;自动居中的效果就不会实现。 2、盒子模型的三位立体结构图中从第一层到第五层依次为:border、content+padding、background-image、background-color、margin。 3、 阅读全文
posted @ 2016-12-15 23:28 fireporsche 阅读(852) 评论(0) 推荐(0) 编辑
摘要: #menu{ height: 65px; width:100%; background-color: rgba(0, 0, 0, 0.5);}#menu ul{ list-style: none;}#menu ul li{ float: left; position: relative;/*如果这里 阅读全文
posted @ 2016-12-15 19:17 fireporsche 阅读(510) 评论(0) 推荐(0) 编辑