What is the difference between AJAX and JavaScript? -

Discussion in 'JavaScript' started by 3DProf4online, Aug 28, 2008.

  1. #1
    I am sorry for being a beginner in website development field. I would like to clarify the question about the differences between AJAX and JavaScript? All information is highly appreciated, thanks in advance!
     
    3DProf4online, Aug 28, 2008 IP
  2. xlcho

    xlcho Guest

    Messages:
    532
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Javascript is a client-side programming language. AJAX is just a term. It's not a programming language or something.. This is when you use javascript to asynchronously send a http request to a server, which will then return you whatever you were looking for and you can use it on the page. This way you can do stuff without reloading the page, which was not possible before the idea of AJAX. I can go on all night long, but I hope you got the idea :)
     
    xlcho, Aug 28, 2008 IP
  3. jack_ss

    jack_ss Guest

    Messages:
    94
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Ugh. I hate that question, but not as much as I hate a client asking me to code a site "in AJAX".

    Anyway, to answer the question, Ajax is a prince of Salamis. He was the second strongest warrior in the Trojan war, next to Achilles, and fought Hector to a draw. It's also a scripting technique for silently loading new data from the server. AJAX (Asynchronous JavaScript and XML) scripts commonly use the soon to be standardized XMLHttpRequest Javascript object. An AJAX script is by itself useless, it also requires a server side application to handle the received data in the document.
     
    jack_ss, Aug 28, 2008 IP
  4. mkda

    mkda Active Member

    Messages:
    139
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #4
    mkda, Aug 28, 2008 IP
  5. 3DProf4online

    3DProf4online Peon

    Messages:
    906
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Ok, thanks, could you please explain what things on a website can be done using AJAX only! Thanks in advance!
     
    3DProf4online, Sep 9, 2008 IP
  6. ilook

    ilook Well-Known Member

    Messages:
    1,602
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    165
    #6
    Ajax is good as it can occur dataload for every task to your server.
    Think about a chatbox, all messages need normally reload the whole page, but when you use ajax you occur it.
     
    ilook, Sep 9, 2008 IP
  7. 3DProf4online

    3DProf4online Peon

    Messages:
    906
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #7
    So it is used to minimize traffic, right?
     
    3DProf4online, Sep 9, 2008 IP
  8. ilook

    ilook Well-Known Member

    Messages:
    1,602
    Likes Received:
    15
    Best Answers:
    1
    Trophy Points:
    165
    #8
    Not only for minimize traffic, also for more easy to show things.
    Example: Youtube.
    When you rate a movie or write a message while you look at the movie, the movie still continues playing.
    If they dont use ajax, the page will completely reload and the movie needs to start from the beginning again.
    Very annoying.

    Another example:

    A Ajax username checker.
    If you become a member of a website its more easy for new members if they can check automaticly whether the username already excist or not.
    In the past you had to fill in the full form, then submit, then it shows "username already exist" and you had the fill in the full form again and again.

    Ajax will also occur this :)

    These are just some small examples of what ajax can do.
     
    ilook, Sep 9, 2008 IP
  9. renlok

    renlok Well-Known Member

    Messages:
    457
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #9
    yeah its mainly for if you just want to update the content of one section of the page
     
    renlok, Sep 9, 2008 IP