Results tagged Ajax

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
Ajax.jpg
Yes, Ajax is a powerful household and industrious cleaner, but it has also become a powerful and dynamic part or our web surfing and web environment world. AJAX stands for Asynchronous JavaScript and XML. What is that? It's not a language, but it is considered more to be an array of web environment tools and or languages. JavaScript gives us the ability to work with and modify the Object model and XML gives us a delivery of content for our documents. When using Ajax applications in your web pages you are using not only using JavaScript and XML, but your using all resources that are available to you in your browser environment and/or server configuration. CSS is used for the styling and placement while HTML can be used the same way as CSS(if need be). Other languages(php, asp, java) are also used to handle server side requests and responses. These other languages do not understand that a request is being being from an Ajax application. They just see that a request has been made, so there isn't any additional configuration that needs to be implemented

JavaScript can be and is mostly used as asynchronous web tool already, but what makes JavaScript an Ajax application is the use of the XMLHttpRequest object. The XMLHttpRequest Object permits your web pages or users to to fetch server side content while still playing with or reading the web page that they are currently on.

The term Ajax is a generalization of the technologies that allow this interaction with server side content. Huh? An XMLHttpRequest does not only have to fetch XML docs. It can fetch any type of content(Video, Audio, XML, DB content, etc).

So let's make an XMLHttpRequest connection:
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
Javascript used to be my enemy. It was a language that was boring and I felt that it had nothing to offer but form validation and a couple other things like rollover images and popup windows. Now, if you know javascript, XML, and the DOM, "May the Force be with you"! Your power to manipulate your internet/intranet sites is huge. From adding dynamic data to your site without a reload of your browser to, well, to being able to do pretty much anything with an onmouseover or any of the events(1) javascript offers.

But, know when and why to use Ajax. Ajax has become a buzzword, as was Flash and Java. People have asked for Ajax applications when there is really no need or purpose for it. Other languages and or technologies would be much more useful to use. Such as one person asking for her e-commerce site to be written in Ajax. Certainly suggested to not do that. E-commerce is not something you want to run with Ajax. Leave that to the server to handle. Agree?

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
Asynchronous: of, used in, or being digital communication (as between computers) in which there is no timing requirement for transmission and in which the start of each character is individually signaled by the transmitting device.

Synchronous:
of, used in, or being digital communication (as between computers) in which a common timing signal is established that dictates when individual bits can be transmitted and which allows for very high rates of data transfer.

So what does this mean for me and my websites. It's a difference of time. Take for instance fast food and cooking a meal. Fast food is already prepared and just needs to be formatted or slapped between two pieces of bread and put into some type of wrapper before it can be enjoyed (If you enjoy fast-food).
Cooking a meal can be considered synchronous because you have to prepare and cook the meal before you can enjoy it. A time difference of Asynch (5-10 minutes) or Synch (30-60 minutes). With website content an asynchronous action is content that is being retrieved and loaded to your document behind the scenes. Your user does not have to wait long or take further action for the requested content to be displayed. Your user can continue to read your web page while the request is being processed. A synchronous action takes a user to either refresh(f5) or click a link to go to a different page.
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