Wrox Programmer Forums
|
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 6th, 2007, 10:21 AM
Registered User
 
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default XmlHttpObject

Say something about XMLHttpObject? Wanna be know something about it.

Ashutosh Nalin
 
Old January 4th, 2008, 05:36 AM
Authorized User
 
Join Date: Jul 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mujahidkhaleel
Default

XMLHttpObject is used to create HTTP request through javascript. This object is used in AJAX. You can do both GET and POST request.

An example can be found here http://www.ripplecreations.com/technology/ajax.php
 
Old February 15th, 2008, 10:25 AM
Registered User
 
Join Date: Jan 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I like to know how to add this is in the js. BECAUSE WHENEVER i TRY TO MANIPULATE IT IN mozilla it gives me a n error message "oXMLHttp.Open is not a function".

Can you suggest me any help on this?

Thanks


My code is like this;

function ClientHTTPRequest(sRequestXML)
{
var oError;
var oXMLHttp;

//CODE FOR FIREFOX
if (window.XMLHttpRequest)
{ alert (" XMLHttpRequest");
var oXMLHttp =new XMLHttpRequest();
if (oXMLHttp.onreadystatechange)
oXMLHttp.onreadystatechange = state_Change
else
alert ("document.onreadystatechange not found") ;
oXMLHttp.Open("GET","../test/testDB.aspx",false);
oXMLHttp.onreadystatechange = Statechanged()
alert ("oXMLHttp.open ended");
oXMLHttp.send(null);
alert ("oXMLHttp.send ended") ;
}
//CODE FOR FIREFOX
else if (window.ActiveXObject)
{ alert("Active xobject");
 oXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
if (oXMLHttp)
{ oXMLHttp.onreadystatechange = state_Change
oXMLHttp.open("GET","../test/testDB.aspx",true)
oXMLHttp.send() }
}
}

function state_Change()
{
if (oXMLHttp.readyState == 4) // "loaded"
{
if (oXMLHttp.status == 200) // "OK"
{ alert("XML data OK");
     return oXMLHttp.responseXML.documentElement;
}
}











Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.