Results tagged xml

jQuery-logo.gifIf you have written some Ajax code using JavaScript you already know how much you have to write to accomplish the desired results. There's 10-15 lines of code to check for and validate the browser type (XMLHttpRequest, ActiveXObject) and all the error handling (try, catch) blocks. Then you have to verify the readyState Response values and hope you get a 4(Complete) so you can move on to manipulate and use the responseText. That's a whole lot of work, but made easy if you choose to use jQuery. What was done in a possible 40+ lines of code can be done in less that 1/2 the lines, not counting the actual jQuery Library code itself.

There are 6 different ways to make an Ajax call using jQuery, but we're going to keep it simple with the most basic of them which is .ajax()

View the working example here.

Let's get an Ajax call working with jQuery.

    $.ajax({

          url: 'url',
          dataType: 'xml',

          success: function(data) {

             // Manipulate the returned data here or elsewhere

          }
    });

That's pretty much all you need to start with. Now let's make it do something.
BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota
| | Comments (0) | TrackBacks (0)
BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, BMW, BMW, BMW, BMW, Acura, Honda, Acura Forerunner, SUV, BMW, Mercedes, Toyota


Chicago Blackhawks
Chicago Blackhawks
Stanley Cup
Stanley Cup
Pittsburgh Penguins
Pittsburgh Penguins
Boston Bruins
Boston Bruins
Fire & Flames
Fire & Flames








 


Categories

BMW, Toyota, BMW, Saab, Audi, Nissan Mercedes, BMW, Nissan, Honda, Acura, Honda, Acura Forerunner,bmw bmw bmw SUV, BMW, Mercedes, Toyota