備份,以前讀過,現在沒時間再讀一次
備份,一樣沒時間讀完,有稍微瞄過前面
堅持只做自己喜歡的事,恩.....我喜歡,跟我很像 XD相關聯的三篇文章
- JavaScript Objects in Detail | JavaScript is Sexy
- Understand JavaScript’s “this” With Clarity, and Master It | JavaScript is Sexy
- JavaScript’s Apply, Call, and Bind Methods are Essential for JavaScript Professionals
第一篇文章,開始
我滿喜歡他這裡對object的解釋,他就像是一個清單,告訴你這object裡有什麼,透過名字(name)來取得相關的資訊(value)
- An object is an unordered list of primitive data (and sometimes reference data types) types that are stored as name-value pairs. Each item in the list is called a property (functions are called methods) and each property name has to be unique and can be a string or a number.
- Think of an object as a list that contains items and each item (a property) in the list is stored by a name-value pair.
裡頭提到一個有趣的東西,reference data type與primitive data type,其實概念滿簡單的,reference data type在 reference primitve的value後,就取了當下primitve的value,以後primitive的value不管怎麼更動,都不會影響到reference的value。(見第三個paradigm,解釋的非常清楚)
- One of the main differences between reference data type and primitive data types is reference data type’s value is stored as a reference, it is not stored directly on the variable
好,休息!!! 我們來看程式碼吧 XD, by blogger record,今天就來看如何做出選單 ^_^
- src\threex.tvset\examples
直接開來玩玩發現有點類似超連結的感覺,稍微讀了一下牠的code,他是利用CSS的技巧,修改<style>去改button大小,說穿了就只是個超連結 =..=
恩..........有點弱,去看別的好了,loading與Start的選項
- D:/work/WebGL%20Learning/three.js-master/examples/webgl_loader_scene.html
稍微瀏覽,好長喔 QQ
休息一下,找到一個在three.js裡loading Blender裡面的 model的資料
無聊搜尋資料時,發現似乎可以用jQuery與CSS做浮動下拉式選單
找到一個人家已經寫好的各種選單樣式的網站,可以直接拿來用
下拉選單製作教學
這節接著提幫我們稍微複習一下prototype
接著下一節的標題就是Prototype Pattern for Creating Objects,簡單來說prototype就是讓你寫好的property與method,可以給其他人調用,而且prototype的好處是,不用直接定義在object的body裡面,請閱讀Practical Patterns for Creating Objects的paradigm與Prototype Pattern for Creating Objects的paradigm,相互比較就能體會prototype的強大了!!!
對於兩種模式想要進一步學習可以去讀別的資料
回頭繼續讀JavaScript Objects in Detail,讀到Constructor Pattern for Creating Objects這節,這節的paradigm教我們如何做出類似以前寫C時,寫個可以input東西進去的副程式,by this keyword,這非常之實用
這節接著提幫我們稍微複習一下prototype
- An inherited property is defined on the object’s prototype property.
- For example: someObject.prototype.firstName = “rich”;
接著下一節的標題就是Prototype Pattern for Creating Objects,簡單來說prototype就是讓你寫好的property與method,可以給其他人調用,而且prototype的好處是,不用直接定義在object的body裡面,請閱讀Practical Patterns for Creating Objects的paradigm與Prototype Pattern for Creating Objects的paradigm,相互比較就能體會prototype的強大了!!!
對於兩種模式想要進一步學習可以去讀別的資料
- read Chapter 6 of Professional JavaScript for Web Developers (現在已出到3rd了)
接著繼續讀時讀到一個字"enumerable",翻譯:枚舉、列舉,恩......不懂!!! 找到一篇文章,我覺得他的解釋我滿喜歡的
- object oriented - What does 'enumerable' mean? - Programmers Stack Exchange
- Mathematically, enumerable means "can be placed into a one to one correspondence with the natural numbers". Most representations in computing are enumerable because they are made of strings of bits, and strings of bits can be taken to denote numbers in the binary system.
有稍微了解一點點,但還是沒什麼感覺,下一篇
讀這篇時讀到下面這段話有感
- Enumerable properties. You can hide properties from some operations by making them non-enumerable. Enumerability is one of the three attributes of a property: writability, enumerability, configurability
默默地想起現在讀JavaScript Objects in Detail時就曾看過這幾句話:
Each data property (object property that store data) has not only the name-value pair, but also 3 attributes (the three attributes are set to true by default):
- Configurable Attribute: Specifies whether the property can be deleted or changed.
- Enumerable: Specifies whether the property can be returned in a for/in loop.
- Writable: Specifies whether the property can be changed.
接著讀到prototype這keyword,於是估狗一下這作者寫過的prototype文章,在此備份,相信很快就會讀到
先到這邊,明天繼續從JavaScript Objects in Detail的Own and Inherited Properties這節開始