Ajax without xmlhttp

  • Thread starter balakrishnan.dinesh
  • Start date
B

balakrishnan.dinesh

hi frnds,

Is Ajax can only used as xmlhttp or else it can use for
anyother purpose,
If any sample example code for that, plz reply to me soon.

Thanks
Dinesh B...
 
D

David Dorward


Nasty, and poorly understood, buzzword
can only used as xmlhttp or else it can use for
anyother purpose,

XMLHttpRequest is /how/ Ajax is usually achieved, it isn't the purpose
of the technique.

Alternatives include frames, iframes, and passing data through the
query strings of images.
 
R

Roy A.

(e-mail address removed) skrev:
hi frnds,

Is Ajax can only used as xmlhttp or else it can use for
anyother purpose,
If any sample example code for that, plz reply to me soon.

Her is a simple AJAX Tutorial: http://www.w3schools.com/ajax/

You may want to ad support for IE when using the XMLHttpRequest Object:

function GetXmlHttpObject(handler)
{
var objXMLHttp=null
// Firefox, Opera 8.0+, Safari
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
// Internet Explorer
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
 
P

pcx99

hi frnds,

Is Ajax can only used as xmlhttp or else it can use for
anyother purpose,
If any sample example code for that, plz reply to me soon.

Thanks
Dinesh B...

You don't have to use xml to pass data back and forth if that was your
question but otherwise xmlhttp IS Ajax. Another page linked to the w3
tutorials, I'll link you to mine since it shows how to pass data with
iframes in addition to ajax. (warning: self promoting link)
http://www.hunlock.com/blogs/AJAX_for_n00bs

Cheers.
 
R

Randy Webb

Roy A. said the following on 1/8/2007 8:47 AM:
(e-mail address removed) skrev:

Her is a simple AJAX Tutorial: http://www.w3schools.com/ajax/

You may want to ad support for IE when using the XMLHttpRequest Object:

Someone might want to tell w3schools to test the code in IE7.
function GetXmlHttpObject(handler)
{
var objXMLHttp=null
// Firefox, Opera 8.0+, Safari

And IE7
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
// Internet Explorer

IE version 6 and prior.
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")

And if the IE browser doesn't use/have Microsoft.XMLHTTP? Another reason
I find the level of script tutoring at w3schools to be questionable at best.
 
R

Randy Webb

David Dorward said the following on 1/8/2007 6:20 AM:
Nasty, and poorly understood, buzzword


XMLHttpRequest is /how/ Ajax is usually achieved, it isn't the purpose
of the technique.

Alternatives include frames, iframes, and passing data through the
query strings of images.

And dynamically loading .js files :)
 
R

Roy A.

Randy Webb skrev:
Someone might want to tell w3schools to test the code in IE7.


And IE7


IE version 6 and prior.


And if the IE browser doesn't use/have Microsoft.XMLHTTP? Another reason
I find the level of script tutoring at w3schools to be questionable at best.

Yes, IE7 XMLHttpRequest may and are probably implemented diffrent than
the other browsers. However, the object instance objXMLHttp is used in
the same way for both XMLHttpRequest and XMLHTTP, and it seems to
confirm with the working draft of W3C;
http://www.w3.org/TR/XMLHttpRequest. But, I agree, the comment could
sugest that it haven't been tested.

The XMLHttpRequest is just one example of AJAX without XMLHTTP.
 
R

Randy Webb

Roy A. said the following on 1/9/2007 7:11 AM:

Yes, IE7 XMLHttpRequest may and are probably implemented diffrent than
the other browsers.

Yes it is. IE7 uses a native object instead of an ActiveX object for the
XMLHttpRequest.
However, the object instance objXMLHttp is used in
the same way for both XMLHttpRequest and XMLHTTP, and it seems to
confirm with the working draft of W3C;
http://www.w3.org/TR/XMLHttpRequest. But, I agree, the comment could
sugest that it haven't been tested.

The XMLHttpRequest is just one example of AJAX without XMLHTTP.

Think about what that line says.

XMLHttpRequest without XMLHTTP?
 
P

pangea33

Randy said:
Roy A. said the following on 1/9/2007 7:11 AM:



Yes it is. IE7 uses a native object instead of an ActiveX object for the
XMLHttpRequest.


Think about what that line says.

XMLHttpRequest without XMLHTTP?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

As has already been mentioned the term AJAX implies the use of XML, but
it's sometimes a little fickle in my experience. Perhaps Roy made a
typo and intended to reference "http.responseText" instead of
"XMLHTTPRequest".

I always seem to run into small snags with XML and have resorted to
using simple character-delimited lists, when my problem domain doesn't
require anything more sophisticated. Here's an example of that, where
my data page will return a pipe-delimited list with 3 elements. For
example: "112197|1.4696248|0.5309032" which is the primary key of my
record, longitude, and latitude.

Even though this is a bastardization of "AJAX" it works well and saves
me a lot of headache.


RESPONSE HANDLER:
function useHttpResponse() {
if (http.readyState == 4) {
if(http.status == 200) {
if ( http.responseText.length ) {
var aLong = http.responseText.split('|');
lngPtr = document.getElementById(longAmt);
latPtr = document.getElementById(latAmt);
lngPtr.value = aLong[1];
latPtr.value = aLong[2];
}
}
}
}


DATA PAGE:
<?php
// include db and query components
require_once("qryMySQLConn.php");
require_once("qryDataUDF.php");
$rsZipDtl = getZipDetail($_GET[userString]);
if ( $rsZipDtl ) {
for ($i=0; $i<mysql_num_rows($rsZipDtl); $i++) {
$ntRowObj = mysql_fetch_object($rsZipDtl);
if($i) {
$cLineStr = "~";
}
else {
$cLineStr = "";
}
$cLineStr =
$cLineStr."$ntRowObj->zipID|$ntRowObj->zipRLongitude|$ntRowObj->zipRLatitude";
}
}
echo($cLineStr);
?>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top