Connecting Tech Pros Worldwide Help | Site Map

jquery and ajax

pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 405
#1: Oct 5 '09
hii guys,
I am newbie to jquery and ajax .

I am stuck to know when to use jquery and ajax . which is better to use and fast .
can anyone plz explain .
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#2: Oct 5 '09

re: jquery and ajax


jquery and AJAX are two very different things. jquery is a javascript library, while AJAX (Asyncronous Javascript and XML) is a programming pattern (it’s about doing a server request). thus you can do AJAX with the help of jquery (but not vice versa).
pradeepjain's Avatar
Needs Regular Fix
 
Join Date: Jul 2007
Location: India
Posts: 405
#3: 5 Days Ago

re: jquery and ajax


i am bit confused ..

i do it this way using jquery to get the result from server with out refresh of page like
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     $("#mobile_brand").change(function() {
  4.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  5.  $("#change").html(data);
  6. });
  7.     });
  8. </script>

so whats will be the difference if i do it in ajax!
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,629
#4: 5 Days Ago

re: jquery and ajax


Quote:

Originally Posted by pradeepjain View Post

i do it this way using jquery to get the result from server with out refresh of page […] so whats will be the difference if i do it in ajax!

don’t confuse a technique (or pattern) with a library. to answer the question, what you do there is ajax, with the help of jquery.
Reply