Friday, 7 February 2014

Adding jQuery & Verifying

  1. Download jQuery from jQuery Download
  2. Download either the compressed, production jQuery or uncompressed, development jQuery.
  3. Place the jquery-1.11.0.min.js in the same folder as your .html file.
  4. Now, add the below code within your <head> tag in your HTML file.
<script type="text/javascript" src="jquery-1.11.0.min.js">
</script>
  1. Add the below lines just before the <body> tag closes.
<script type="text/javascript">
  if(typeof jQuery == 'undefined') {
    alert('jQuery Unavailable')
  } else {
    alert('jQuery Ready');
  }
</script>

If jQuery was successfully loaded in the page, You should see the text jQuery Ready pop up on the page.

Note:
  • Please change the jquery-1.11.0.min.js specified in the src with your own jQuery filename.
Any comments / suggestions are always welcome.

No comments :

Post a Comment