FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore(jquery): syntax highlight for JS by teppeis · Pull Request #28 · azu/JavaScript-Plugin-Architecture · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .md  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 3 additions & 3 deletions ja/jQuery/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jQueryプラグインはprototype拡張のように `$.fn.greenify = function ()

`jQuery.fn`の実装を見てみると、実態は`jQuery.prototype`であるため実際にprototype拡張していることがわかります。

```
```js
// https://github.com/jquery/jquery/blob/2.1.4/src/core.js#L39
jQuery.fn = jQuery.prototype = {
// prototypeの実装
Expand All @@ -31,7 +31,7 @@ jQuery.fn = jQuery.prototype = {

`$()`は内部的に`new`をしてjQueryオブジェクトを返すので、このjQueryオブジェクトではprototypeに拡張したメソッドが利用できます。

```
```js
$(document.body); // 返り値はjQueryのインスタンス
```

Expand Down Expand Up @@ -65,7 +65,7 @@ jQueryではそこをどうやってカバーしているかというと、

`$.fn`と同様に`prototype`へのaliasを貼っているだけのただのコンストラクタ関数です。

```
```js
calculator.fn = calculator.prototype;
```

Expand Down

Back | FazBrowse Home | New Git URL