Re: Is AJAX a heavy framework?
Angel <[email protected]> Wed, 29 Jun 2022 06:01:22 -0700 (PDT)
| Newsgroups | alt.comp.lang.javascript |
|---|---|
| Message-ID | <[email protected]> |
What do you mean by that ?
The way I see it, it is not heavy at all.
**********************************************************************
Javascript's built in ajax handling:=20
var objXMLHttpRequest =3D new XMLHttpRequest();
objXMLHttpRequest.onreadystatechange =3D function() {
if(objXMLHttpRequest.readyState =3D=3D=3D 4) {
if(objXMLHttpRequest.status =3D=3D=3D 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=C3=BChap=C3=A4ev, 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, an=
d=20
> I'm considering using it. However i've heard that using the AJAX framewor=
k=20
> slows the loadtime of the site because the framework is rather heavy. Is=
=20
> there any thuth to this?
> Thanx
> Mike