Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.lang.javascript > #80

Re: Is AJAX a heavy framework?

Newsgroups alt.comp.lang.javascript
Date 2022-06-29 06:01 -0700
References <4531fb49$0$144$157c6196@dreader2.cybercity.dk>
Message-ID <950cbe2e-732a-424a-bbc4-6c89a7a1b5b7n@googlegroups.com> (permalink)
Subject Re: Is AJAX a heavy framework?
From Angel <he12091983@gmail.com>

Show all headers | View raw


What do you mean by that ?

The way I see it, it is not heavy at all.

**********************************************************************
Javascript's built in ajax handling: 

var objXMLHttpRequest = new XMLHttpRequest();
objXMLHttpRequest.onreadystatechange = function() {
  if(objXMLHttpRequest.readyState === 4) {
    if(objXMLHttpRequest.status === 200) {
          alert(objXMLHttpRequest.responseText);
    } else {
          alert('Error Code: ' +  objXMLHttpRequest.status);
          alert('Error Message: ' + objXMLHttpRequest.statusText);
    }
  }
}
objXMLHttpRequest.open('GET', 'request_ajax_data.php');
objXMLHttpRequest.send();
************************************************************************

If You use Jquery library ajax, then this will be slower, because Jquery is about 50KB.

***********************************************************************************
Jquery ajax:

$.ajax(
  'request_ajax_data.php',
  {
      success: function(data) {
        alert('AJAX call was successful!');
        alert('Data from the server' + data);
      },
      error: function() {
        alert('There was some error performing the AJAX call!');
      }
   }
);
************************************************************************************


*******************************
Angel


Mike kirjutas Pühapäev, 15. oktoober 2006 kl 11:11:41 UTC+2:
> Hi
> I've read about AJAX and is fairly impressed by what it can do for me, and 
> I'm considering using it. However i've heard that using the AJAX framework 
> slows the loadtime of the site because the framework is rather heavy. Is 
> there any thuth to this?
> Thanx
> Mike

Back to alt.comp.lang.javascript | Previous | NextNext in thread | Find similar


Thread

Re: Is AJAX a heavy framework? Angel <he12091983@gmail.com> - 2022-06-29 06:01 -0700
  Re: Is AJAX a heavy framework? denodster@gmail.com (Denodster) - 2023-12-17 20:30 -0500

csiph-web