01 2018 档案

摘要:// return obj { length: 字节长度, limitStr: 限定的字符串(字节长度小于等于intVal) } function getStringByteInfo ( string, intVal ) { var str = $.trim(string) || '', lengt 阅读全文
posted @ 2018-01-22 14:51 艾礼富 阅读(174) 评论(0) 推荐(0)
摘要:document.write(unescape("\u62db\u8d22\u7ae5\u5b50")) 阅读全文
posted @ 2018-01-15 16:10 艾礼富 阅读(128) 评论(0) 推荐(0)
摘要:var classVal = document.getElementById("id").getAttribute("class"); //删除的话 classVal = classVal.replace("someClassName",""); document.getElementById("i 阅读全文
posted @ 2018-01-15 14:57 艾礼富 阅读(173) 评论(0) 推荐(0)
摘要:$.fn.extend({ propAttr: $.fn.prop || $.fn.attr, _oldFocus: $.fn.focus,//为避免与jQuery ui冲突导致死循环,这里不要取名为'_focus' //设置元素焦点(delay:延迟时间) focus: function( del 阅读全文
posted @ 2018-01-08 09:55 艾礼富 阅读(155) 评论(0) 推荐(0)
摘要:有三种方法能够确定浏览器窗口的尺寸(浏览器的视口,不包括工具栏和滚动条)。 对于Internet Explorer、Chrome、Firefox、Opera 以及 Safari: window.innerHeight - 浏览器窗口的内部高度 window.innerWidth - 浏览器窗口的内部 阅读全文
posted @ 2018-01-06 09:59 艾礼富 阅读(1861) 评论(0) 推荐(0)
摘要:面比较一下默认输出和正常输出。 // 第一组export default function crc32() { // 输出 // ...} import crc32 from 'crc32'; // 输入 // 第二组export function crc32() { // 输出 // ...}; 阅读全文
posted @ 2018-01-06 09:29 艾礼富 阅读(208) 评论(0) 推荐(0)
摘要:React.createClass({ propTypes: { // 可以声明 prop 为指定的 JS 基本数据类型,默认情况,这些数据是可选的 optionalArray: React.PropTypes.array, optionalBool: React.PropTypes.bool, o 阅读全文
posted @ 2018-01-05 13:43 艾礼富 阅读(247) 评论(0) 推荐(0)
摘要:在组件完成加载之后,我们可以通过setState方法来改变我们设置的属性的值。 首先在render函数中加入一个input元素,用于触发onChange事件,然后调用setState方法。 /*** @jsx React.DOM */var APP = React.createClass({ get 阅读全文
posted @ 2018-01-05 10:29 艾礼富 阅读(1374) 评论(0) 推荐(0)
摘要:<script type="text/babel"> var Hello=React.createClass({ render:function(){ return <span>1</span>; } }); ReactDOM.render(<Hello />, document.getElemen 阅读全文
posted @ 2018-01-04 21:06 艾礼富 阅读(106) 评论(0) 推荐(0)