添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

FCC is teaching that the JQuery Ready function should be invoked as:

$(document).ready(function() {
// Handler for .ready() called.

As of jQuery 3.0 , that syntax was deprecated. The new syntax is:

$(function() {
// Handler for .ready() called.

We want our prospective employers to know that we are staying current. jQuery 3.0 was released over a year ago. Ready is such an important jQuery function that I wanted to get the word out.

I just now encountered the deprecated syntax on the first jQuery challenge, so I assume it is being used throughout FCC. Hopefully someone can bring this issue to the attention of the FCC developers. Thanks!

The new method looks shorter, freeCodeCamp could potentially be teaching you with this method to help you understand that the code will only once the document is ready. This is just my speculation and I’m not exactly sure. freeCodeCamp did a video on jquery which is helpful to understanding exactly how jquery works. I do think it’s worth mentioning the shorter way to do it at some point in the challenges, maybe this will change once the beta enters production.

SkyC:

The Free Code Camp Challenges are a few years old now and use jQuery v2.1.4. This is great feedback for the Beta though in case it hasn’t already been considered.

I wasn’t sure about the version being used - beta is going to do a lot of updates so jQuery 3 or 3.1 might be used once beta is completed. It’s good to know about the shorter way to do that.