jQuery Setup and Simple Reminder Methods

12/23/2013 5:29:17 PM

The following is for setting up jQuery and using document and window load events to do something.

<html>
    <head>      	
		//USE ONLY 1 jQuery CDN
		
		//Google jQuery CDN
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
		
		//jQuery CDN
		<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
		
		//ASPNET jQuery CDN
		<script src="//ajax.aspnetcdn.com/ajax/jquery/jquery-1.10.2.min.js"></script>
        
		<script type="text/javascript">
			
			$(window).ready(function()
			{
				//fired when all page is fully loaded including images
			});
			
			
			$(document).ready(function()
			{
				//fires when DOM is ready

				//grab an object by Id and show it (it is was hidden)
				$("#objectId").show();
				
				//grab an object by class and show it (it is was hidden) - will affect all objects with the specified class
				$(".myClass").show();
			});
			
		</script>
		
    </head>
    
    <body>    	
    </body>
</html>