Jquery is a Library fucntion of Javascript.It's very easy to write and very much faster than Javascript. When we use onLoad event handler on body tag ,the onload function will fired when all body content will download successfully ,that means all the image should download completely,then only this event will fired.But in Jquery when your Html DOM(Document Object Model) will load completely than the Jquery function can be fired,it's no need to wait for downloading any Image.That is why it is very nuch popular than other language/script.
For example I am going to give red color into all h1 tag When this page will loaded. For that i will write
<script type="text/javascript">
$(document).ready(function(){
$('h1').css('color','red');
});
</script>
Before Run this script You need to link JQUERY Library into your page which you can get from these links
http://code.jquery.com/jquery-1.4.2.min.js
or you can use this one
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
Attach any one of this script then You can see the effect only
I didn't knew anything about the Jquery function of Javascript. Now i know something about it from this article and it was easier to understand as its explained with an example.
ReplyDeleteThank you for explaining the difference between Jquery and Javascript. I dont have much knowledge about this two until you blog it here. The tips presented here are very useful to us. Keep on helping and giving us information about programming. Well done!
ReplyDelete