03 2015 档案

摘要:var CommentBox = React.createClass({ loadCommentsFromServer: function() { $.ajax({ url: this.props.url, dataType: 'json', success: ... 阅读全文
posted @ 2015-03-25 18:18 bjsunhe 阅读(1103) 评论(0) 推荐(0)
摘要:Hello React var CommentBox = React.createClass({ render: function() { return ( Hello, world! I am a Co... 阅读全文
posted @ 2015-03-25 18:09 bjsunhe 阅读(256) 评论(0) 推荐(0)
摘要:Component PropertiesNow that we have defined theCommentcomponent, we will want to pass it the author name and comment text. This allows us to reuse th... 阅读全文
posted @ 2015-03-24 17:43 bjsunhe 阅读(437) 评论(0) 推荐(0)
摘要:A Quick Introduction to ReactReact is, according to their own definition, “A Javascript library for building user interfaces.” When I first read about... 阅读全文
posted @ 2015-03-24 16:39 bjsunhe 阅读(299) 评论(0) 推荐(0)
摘要:Your first componentReact is all about modular, composable components. For our comment box example, we'll have the following component structure:你的第一个... 阅读全文
posted @ 2015-03-24 16:24 bjsunhe 阅读(768) 评论(0) 推荐(0)
摘要:JavaScript is a lexically scoped language: the scope of a variable can be thought of asthe set of source code lines for which the variable is defined.... 阅读全文
posted @ 2015-03-19 18:19 bjsunhe 阅读(162) 评论(0) 推荐(0)
摘要:Speed has always been one of Chrome's primary missions, ever since it was included as one of the founding principles in 2008. But speed is about more ... 阅读全文
posted @ 2015-03-19 17:12 bjsunhe 阅读(195) 评论(0) 推荐(0)
摘要:.on( events [, selector ] [, data ], handler )Description:Attach an event handler function for one or more events to the selected elements.绑定一个事件处理函数到... 阅读全文
posted @ 2015-03-19 16:41 bjsunhe 阅读(177) 评论(0) 推荐(0)
摘要:1. 使用最新版本的jQuery2. 用对选择器(1)最快的选择器:id选择器和元素标签选择器3. 理解子元素和父元素的关系4. 不要过度使用jQuery5. 做好缓存6. 使用链式写法7. 事件的委托处理(Event Delegation)。javascript的事件模型,采用"冒泡"模式,也就是... 阅读全文
posted @ 2015-03-19 16:04 bjsunhe 阅读(126) 评论(0) 推荐(0)
摘要:选择某个网页元素,然后对其进行某种操作 $(document) //选择整个文档对象 $('#myId') //选择ID为myId的网页元素 $('div.myClass') // 选择class为myClass的div元素 $('input[name=first]') // 选择name属... 阅读全文
posted @ 2015-03-19 15:38 bjsunhe 阅读(227) 评论(0) 推荐(0)
摘要:deferred对象的多种方法 (1)$.Deferred()生成一个deferred对象。 (2)deferred.done()指定操作成功时的回调函数 (3)deferred.fail()指定操作失败时的回调函数 (4)deferred.promise()没有参数时,返回一个新的def... 阅读全文
posted @ 2015-03-19 14:34 bjsunhe 阅读(136) 评论(0) 推荐(0)
摘要:Javascript语言的执行环境是"单线程"(single thread)一次只能完成一件任务。如果有多个任务,就必须排队,前面一个任务完成,再执行后面一个任务Javascript语言将任务的执行模式分成两种:同步(Synchronous)和异步(Asynchronous)"异步模式"则完全不同,... 阅读全文
posted @ 2015-03-19 14:25 bjsunhe 阅读(162) 评论(0) 推荐(0)
摘要:教人写代码 阅读全文
posted @ 2015-03-19 12:37 bjsunhe 阅读(154) 评论(0) 推荐(0)
摘要:The try/catch/finally statement is JavaScript’s exception handling mechanism.try/catch/finally语句是js的异常处理机制。Thetry clause of this statement simply defi... 阅读全文
posted @ 2015-03-18 15:27 bjsunhe 阅读(143) 评论(0) 推荐(0)
摘要:JSON parsing and stringificationJSON解析与字符串化JSON is a simple object that serves as the namespace for the global ECMAScript 5 functionsJSON.parse() and ... 阅读全文
posted @ 2015-03-18 15:16 bjsunhe 阅读(235) 评论(0) 推荐(0)
摘要:There are a number of ways to implement Ajax and Comet, and these underlying implementationsare sometimes known as transports.有很多方法可以实现ajax和comet,这些底层... 阅读全文
posted @ 2015-03-18 14:47 bjsunhe 阅读(144) 评论(0) 推荐(0)
摘要:The term Ajax describes an architecture for web applications that prominently featuresscripted HTTP.Ajax描述了一种web应用的架构,这种应用以脚本化HTTP为特点。The key feature ... 阅读全文
posted @ 2015-03-18 14:30 bjsunhe 阅读(129) 评论(0) 推荐(0)