$(document).ready(funciton(){ // code }) // ################## $(function(){ //jQuery code here }); // Adding the jQuery can help prevent conflicts with other JS frameworks jQuery(document).ready(function($) { //do jQuery stuff when DOM is ready }); // ################################# jQuery.noConflict(); // Reverts '$' variable back to other JS libraries jQuery(document).ready( function(){ //do jQuery stuff when DOM is ready with no conflicts }); //or the self executing function way jQuery.noConflict(); (function($) { // code using $ as alias to jQuery })(jQuery); //####################################### $(window).load(function(){ //initialize after images are loaded });
// For modern browsers, and IE9+, you can listen for the DOMContentLoaded event. // Add an event listener of DOMContentLoaded to the whole document and call an anonymous function. // You can then wrap your code in that function's brackets // and it will execute once loading is complete. document.addEventListener('DOMContentLoaded', function () { // Our hawaiian greeting is displayed as soon as the page loads, console.log('Aloha'); });
Content for the first footer section.
Content for the second footer section.
Content for the third footer section.