On the distinction between jQuery core methods ( .each() ) in the $.fn name space and jQuery utility methods ( $.each() ) not in the $.fn name space

Đang mở
#799 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Tài liệu
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, jquery
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với chương Using jQuery Core và phần “$ vs $()” tại các URL Learn jQuery được liên kết. Sửa lại phần giải thích để phân biệt .each() với $.each(), làm rõ thuật ngữ về $.fn và phương thức của đối tượng, đồng thời bổ sung ngữ cảnh về namespace hoặc một trích dẫn; hoàn tất khi sự khác biệt được nêu rõ đối với người mới bắt đầu.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Chapter: jquery-core help wanted

The Using jQuery Core chapter begins with the section titled $ vs $().

It's my thought that some additional wording could make the section's lessons more easily realized.

That section draws the distinction between jQuery core (object) methods called on jQuery selections and jQuery utility methods not called on selections. Thrown in on top of that is the further distinction between the $.fn namespace and the $ namespace.

Core (object) methods are identified simply by their names ( .each() ) but are in the $.fn namespace.

Utility methods ( $.each() ) are explicitly identified as members of the jQuery namespace, $, and are not in the $.fn namespace.

Get it?

.each() in $.fn namespace.
$.each() not in $.fn namespace.

My point is that that distinction is not so clearly made in the article. It took me several readings and a day's rumination before the fog lifted. I think that the jQuery novice, who is after all the section's target, would be better served by a more explicit and specific drawing of the distinction than is currently the case.

The point might also be explicitly made that core methods (.remove()) are also called object methods because they have an object, i.e., the jQuery selection ( $( "h1" ) ) upon which they are called ( $( "h1" ).remove() ). I think that would make the terminology seem more sensible and less arbitrary.

May I also suggest that this would be the place to give some insight into the namespace concept, just a paragraph or two. If not, then at least a citation to an article explaining the concept.

Ngôn ngữ chính
JavaScript
Star
914
Fork
472
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jquery/learn.jquery.com

Tất cả issue của jquery/learn.jquery.com

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.