Monday, 11 August 2014

jQuery Basics


jQuery is a cross platform  Javascript library to simplify Javascript programming language and make a compatibility for the various browsers available for the client side HTML scripting or  DOM manipulations..

jQuery 2.x  deprecates  the  support for IE 6 -8 and now only supports the IE 9 onwards along with Chrome , Mozilla , Safari etc browsers makes it lighter in the size.

jQuery 1.x gives the full support for the all the browsers even the older ones like IE 6-7   , that's why  it the most popular and widely used Javascript library in the current web application development world.

It is a  simple and a very powerful library  to work   in the web based applications . It's  based on  "Write less , do more"  principals .

jQuery library contains following features :

1 . HTML/DOM manipulations
2.  CSS selectors based manipulations
3.  HTML event based methods
4.  Animations and effects
5.  Ajax based  handling

Including or Downloading jQuery :

One can download  the latest versions of the jQuery from the jQuery site  http://jquery.com/download/  or
one can include jquery from the CDN available like Google /Microsoft which is being one of the faster  way to load the jquery as once its loaded its takes from the cache . CDN makes sure to serve it from the closest server to the client making it available in a lesser time or faster loading.
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" />
</head>

Lets  understand the DOM tree structure and complete DOM




Document Ready Event : 

 Note : the $ sign represents access to  jQuery

This Ready event prevent any jquery call till document   loading is  completed. If you try to access DOM before the document is loaded , may lead to failure of the action.

$(document).ready(function(){
   // jquery logic is here.
});

OR another shorter way of creating a Document Ready Event as :

$(function(){
//your jquery logic is here
});

$ can access  following three elements :

1. HTML tag elements like $( "div" ) , $(" h1") , $("ul") , $("li") , $("html") , $("body") ,$("a") etc.
2. Classes with dot(.) operator like $(".sample") its gives all the elements having class "sample"
3. ID with hash(#) operator $("#sample-id") , its gives a unique element with the id "sample-id"

Try one sample program of changing color of the text :

****************************************************************

<html>
<head>
    <meta charset="utf-8">
    <title>jQeury Basics</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"> </script>
</head>
<body>
<h1> Welcome to the basics of jQuery !!!!</h1>
<a id="sample-id" href=""> Its an example of ID manipulation. click here to change color to green </a> <br>
<a class="sample-class" href=""> Its an example of class manipulation. click here to change color to blue</a><br>
<p> Demonstration of the  examples of the jQuery tag element manipulation, its  cool!!!!
<a class="p-elements" href=""> click to change the color to red </a></p>
<script>
$( document ).ready(function() {
///OR $(function() {
$("#sample-id").on("click" ,function(event) {
//changes the color of the current text to green
event.preventDefault();
$(this).css("color", "green");
});
$(".sample-class").on("click" ,function(event) {
//changes the color of the current text to blue
event.preventDefault();
$(this).css("color", "blue");
});
$(".p-elements").on("click" ,function(event) {
//changes the color of the all the element p to red
event.preventDefault();
$("p").css("color", "red");
});
 });
</script>
</body>
</html>

****************************************************************


Enjoy the cool jQuery stuff  .... enjoy the learning ... :) 





Saturday, 2 August 2014

Mantras of Self Motivation



Humans have got the Intelligence to understand the nature.Nature in all its universal form is God .Since we have originated from the nature and so  originated from the God .

As Lord Krishna said  in the Bhagwat Gita :

All the Universes are pervaded by Me ,in an imperceptibly subtle manifestation and all living entities find there support in Me ,but I am not supported in them.[chap 9 verse 4 -Bhagwat Gita]

Understand just as the mighty wind blowing everywhere is always situated within the space, similarly all created beings thus situated in Me [chap 9 verse 6 -Bhagwat Gita]

I am the goal, the sustainer, the master, the witness , the refuge, the guardian, the well-wisher ,the creation,the dissolution,the preservation, the reservoir and the imperishable cause.[chap 9 verse 18 -Bhagwat Gita]

Believing the truth ,there is a supernatural power controlling the time and space , and hence controlling us, and He is looking  best for us and also He is thinking every time for us

To hold this truth and start with  self belief , start believing in God .With the grace of Him you have got this life to perform your action and you get all sort of either good or bad expiriences.

Believing the things Happening for best and past was best , present is best and future will also be best .. will definitely give great satisfaction in your life. Mental satisfaction is must to enjoy the life , so what are you thinking now ... Start believing in God and Start believing in yourself.  :) :) :)

Planetary outlook of Bitcoin

Bitcoin was introduced to the world on January 3 , 2009 , exact time is not known so time taken as 12PM . Pl...