Monday, 17 June 2013

jQuery basic

Visit official jquery site. jQuery is javascript library which is cross-platform/ browser, fast, robust, easy to learn. It makes things easy which are difficult to do in alone javascript (although, jQuery itself is in javascript). It creates, virtual namespace (which is advance for beginner, so I am not explaining here). Main benefits of jQuery , 


  • It makes javascript programming easy.
  • Platform independent / Cross- browser
  • It's used by millions of people.
  • Unobtrusive JavaScript. It seperates html and javascript. (Though, it can't seperates100%, and it also depend on your own coding.
  • It is used by wordpress/ wikipedia 
With jQuery / javascript, these things should also be considered,
  • Progressive enhancement - if browser don't support few features of javascript / jQuery, there should be way to access basic content of page. Javascript should provide enhancement/ wow effect. But it doesn't mean, without javascript, we can't access page. Like when you visit, mail.google.com (gmail) and internet is slow, a pop up comes that says, load basic html. It's progressive enhancement.
  •  Degrading gracefully - if javascript is disabled, page should load properly. Like above gmail example.It is reverse of progressive enhancement.
We can use jQuery either hosted by googleapis or upload it on our server. There are 2 versions, minified and compressed versions jQuery (to reduce page size and so it takes less time in downloading) other is developer version. We should always use minified version ( //ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js ) during production of site. As developer version is easy to understand, it's purpose to understand jQuery code. You can download minified jQuery  . To, start, write,
<script src="http:////ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
Now, you are ready to go, see next blog for learning jQuery

No comments:

Post a Comment