Skip to content

Ready: Rewrite to clarify and add jQuery 3.0 notes #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

dmethvin
Copy link
Member

@dmethvin dmethvin commented Aug 6, 2016

Fixes #964 (EDIT: corrected ticket)

Sorry but I still don't have a working docs setup. I hope I got all the markup right, if not let me know.

I'm hoping to have a Mac within a few weeks and maybe I can get things working on that.

<p>All three of the following syntaxes are equivalent:</p>
<p>The <code>.ready()</code> method offers a way to run JavaScript code as soon as the page's Document Object Model (DOM) becomes safe to manipulate. This will often be a good time to perform tasks that are needed before the user views or interacts with the page, for example to add event handlers and initialize plugins. When multiple functions are added via successive calls to this method, they run when the DOM is ready in the order in which they are added. As of jQuery 3.0, jQuery ensures that an exception occuring in one handler does not prevent subsequently added handlers from executing.</p>

<p>Most browsers <a href="http://caniuse.com/#search=DOMContentLoaded">provide similar functionality</a> in the form of a <code>DOMContentLoaded</code> event. However, jQuery's <code>.ready()</code> method differs in an important and useful way: If the DOM becomes ready and the browser fires <code>DOMContentLoaded</code> before the code calls <code>.ready( handler )</code>, the function <code>handler</code> will still be executed. In contrast, a <code>DOMContentLoaded</code> event listener added after the event fires is never executed.<p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have <p> for the closing paragraph tag. Should be </p>.

@kswedberg kswedberg closed this in ba2abaa Aug 6, 2016
@dmethvin
Copy link
Member Author

dmethvin commented Aug 7, 2016

Thanks Karl! 🍰

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants