Javascript:
This is a language which the web browser understands. It was released officially by Microsoft in its IE 3.0 in 1996, at the time when websites were becoming more complex and dynamic. As you would know now, dynamic content (rather flashy content) in websites is the order of the day, and the most popular way to achieve this is using JavaScript. JS is more readable and easier to master in a short span of time.
But initially different browsers interpreted the language in different ways, and developers would spend a lot of their precious time to fix the bugs cased due to that. Hence jQuery was conceived, although in present time, all browsers have begun to implement JS uniformly.
jQuery:
In simple terms, jQuery is a library of JS. In order to make the browsers understand JS in a standard way, developers started building custom frameworks, which simplified HTML document traversing, animation, event handling and AJAX interactions. These frameworks were shared freely in the development world and the concept became so widespread that the birth of jQuery was inevitable. Standard pre-written methods ( .js files) available in the internet are integrated into the project and used by the dynamic content you want to build. Hence jQuery now lets you focus more on developing the dynamic features and less on cross browser issues.
Which is better?
Neither. As said, JavaScript forms the basis of jQuery and the two cannot be separated. Most of the times, jQuery uses fewer lines of code, compared to the same features written using JS. However, since jQuery code also interacts with the same DOM methods as JS but in an indirect way, it cannot be said that jQuery is faster than JS.
Most of the effects you require for your project can be achieved easily with jQuery, hence the use of jQuery library today is more than the traditional JS itself. But to understand the client-side scripting from the bottom-up, it would be better to understand the basic working of both JS and jQuery.
0 comments:
Post a Comment