Checking if the Document is Ready in JQuery
Zenva
ACCESS the FULL COURSE here: https://academy.zenva.com/product/bite-sized-coding-academy/
TRANSCRIPT
So we're going to do something really common and necessary in every jQuery application. First of all, we want to call jQuery, and we do this by typing either jQuery, which is quite lengthy, or typing the dollar sign, which is much cleaner. So dollar sign, we open and close parentheses, and between parentheses I'm going to type document. So we're going to work with the document object as a jQuery object. Okay? Then dot ready. This is going to be a function call. We're going to write what's going to be the ready call back here. So, let's open and close parentheses and add a semicolon. And here I'm going to type a function, open and close parentheses and open and close curly braces. So whenever the document is ready, this function is going to be executed. And here I'm just going to type console.log and the message, "We are ready!" Like this. So we're going to save this script. And here in Google Chrome, I'm going to refresh the page, and we have the message we are ready. Okay, so that's perfect. Since we are now ready to work, and we have this ready function, then that means our path is clear into changing the body tags and adding whatever content we want here.
Free Tutorials:
- Unity: https://gamedevacademy.org
- Phaser: https://phasertutorials.com
- Machine Learning: https://pythonmachinelearning.pro
- Web Dev: https://html5hive.org
- Android: https://androidkennel.org
- Swift: https://swiftludus.org
- VR: https://vrgamedevelopment.pro ... https://www.youtube.com/watch?v=MxDq-MgMvSs
2551963 Bytes