Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
can i know the difference between javascript , jquery, and ajax

and where we should use these... in code

give me the clear idea , don't give me links please

thanks in advance,

Velsamy
Posted
Comments
Sergey Alexandrovich Kryukov 7-Apr-14 23:44pm    
How do we know what you can and what not? Maybe you cannot, just because you don't even understand that such question about "difference" are not correct. You could read about each concepts by yourself. Why do you think that a Quick Answer written specially for you could be better than some well-written answers? And "don't give me links"... it's just your laziness.
—SA
avelsamy 8-Apr-14 5:08am    
Mr, SA, links will give me different ideas about it, that is why i am asking about as practically... ok now tell me

what is javascript, jquery, ajax ?
Sergey Alexandrovich Kryukov 8-Apr-14 11:29am    
The sooner you start reading and analyzing information by yourself, the better. The question is way too trivial and the answer won't help you much, it won't move you to getting any valuable skills. You cannot ask question on many hundreds of notions you would need to master.
—SA

C#
Javascript is a programming language which is used mainly in webpages for making websites interactive. When a webpage is parsed by the browser, it creates an in-memory representation of the page. It is a tree structure, which contains all elements on the page. So there is a root element, which contains the head and the body elements, which contain other elements, which contain other elements. So it looks like a tree basically. Now with javascript you can manipulate elements in the page using this tree. You can pick elements by their id (getElementsById), or their tag name (getElementsByTagName), or by simply going through the tree (parentNode, firstChild, lastChild, nextSibling, previousSibling, etc.). Once you have element(s) to work with you can modify them by changing their look, content or position on the page. This interface is also known as the DOM (Document Object Model). So you can do everything with Javascript that another programming language can do, and by using it embedded into wepages you also get an in-memory Object of the current webpage by which you can make changes to the page interactively.

AJAX is a technique of communication between the browser and the server within a page. Chat is a good example. You write a message, send a message and recive other messages without leaving the page. You can manage this interaction with Javascript on the client side, using an XMLHTTP Object provided by the browser.

jQuery is a library which aims to simplify client side web development in general (the two other above). It creates a layer of abstracion so you can reuse common languages like CSS and HTML in Javascript. It also includes functions which can be used to communicate with servers very easily (AJAX). It is written in Javascript, and will not do everything for you, only makes common tasks easier. It also hides some of the misconceptions and bugs of browsers.
 
Share this answer
 
Comments
avelsamy 8-Apr-14 5:19am    
Thank you very much for your time, it will really help me
To put it in simple terms,

1. Javascript: It is a language designed for use with in the web browser. After server renders a webpage, it send it to the web browser. Without javascript any change in the page has to be done by the server side code which means the webpage has to make a request to the server. But with javascript, the webpage can be modified with the available data in the web browser without making a call to the server. Avoiding server calls means requests are processed quickly.

2. Jquery: Jquery is nothing but javascript. It is like class library written in javascript. Jquery is developed to simplify the javascript code. It implements the most commonly used functions in javascript with a simple and intuitive way. Also the most important point of jquery is cross browser support. Not all browser supports the same javascript versions, there are some difference in how you write javascript for IE and firefox but jquery handles these differences for you so you need not worry about the browser support. It works in all browsers.


3. Ajax: Javascript can be used to make a request to server and receive response. But this type of server call is quite tedious so jquery has implemented a function called Ajax which does it for you. You just need to write simple ajax function in one line and it does the rest for you.

In order to use jquery or ajax you need to include jquery library in your website. But for working with javascript you need not do this.

P.S. There are more to talk about the differences and why use one over the other but I hope these simple points get you a head start with the topics. Please let me know if you have any specific questions.
 
Share this answer
 
Comments
avelsamy 8-Apr-14 5:26am    
Thank you Mr.Govindaraj R, it will really help me, sure i will ....
Govindaraj Rangaraj 8-Apr-14 5:34am    
Thanks for upvoting and I am glad to help!
avelsamy 8-Apr-14 5:34am    
Dear Mr.Govindaraj R,

i am new to jquery and ajax,

whatever we can do with jquery , ajax...
Govindaraj Rangaraj 8-Apr-14 5:43am    
As I mentioned earlier jquery and ajax are nothing but browser side scripting which means you can develop dynamic webpages using them. With jquery you could develop webpages that can update contents dynamically. The first ever functionality I achieved using jquery was to convert a table into boxes made of div tag. Traditionally without javascript we need to rewrite the html from table to div but in jquery you can use the same page with table, but instead of rewriting the table tag you could write jquery code to transform to div dynamically.

Ajax is a simple call to server. Jquery provides several different wrapper for ajax which are very easy to use. One such example is getJSON method. Please google for this method. It gets data from the server in JSON format and you can apply this data dynamically on the page. Which means without reloading a page you update data on the webpage (like a magic) :)
avelsamy 8-Apr-14 5:56am    
Thank you once again G R...
If you want you can refer this CP post..it contains some good solutions

Difference between JavaScript,JQuery,Jason,AJAX[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900