473,473 Members | 1,978 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XmlHttp with mozilla?

anyone have a code example of using xmlhttp with mozilla, if i use the
following code, the function is never called, but it does work in IE.

xmlhttp.onreadystatechange = function()
{

if (xmlhttp.readyState == 4)
{
var response = xmlhttp.responseText;
divResponse.innerHTML += "<p>" + response + "</p>";
}
}

Jul 23 '05 #1
3 2221
I'm not totally sure about this but all the code that I've read has an
extra '&& xmlhttp.status==200' in the conditional. Now that shouldn't
change anything though; it should still work. All code that I've
written like this has worked fine in firefox and looks quite similar.
Check the javascript console for errors. The only thing that I can
think of is that the error is elsewhere. Perhaps when xmlhttp was
created (different than IE). Adding some more code here would also
help. Good luck.

-----Horndude77

Jul 23 '05 #2


jw*****@gmail.com wrote:
anyone have a code example of using xmlhttp with mozilla, if i use the
following code, the function is never called, but it does work in IE.

xmlhttp.onreadystatechange = function()
{

if (xmlhttp.readyState == 4)
{
var response = xmlhttp.responseText;
divResponse.innerHTML += "<p>" + response + "</p>";
}
}


I don't see anything wrong with that code snippet therefore I think the
problem is elsewhere. Make sure that you do
xmlhttp.send(null)
if you don't want to send anything in the request body, with IE you can do
xmhttp.send()
but Mozilla wants the null argument.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
I determined that the problem was because i was calling xmhttp.Send(),
with a capital "S". For some reason this works in IE, but not in
firefox. send() with a lower case "s" is proper.

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Cholewa | last post by:
Hi I'm using Microsoft.XMLHTTP object from within JavaScript HTA application (or WScript). Object is set to use asynchronous mode as following: --------- var oXMLRequest = new...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
2
by: jw56578 | last post by:
I request a response with xmlhttp. I'm testing it on mozilla and explorer. mozilla returns "undefined" unless i "alert" the value of the response first. explorer works fine. what is the problem.
12
by: Botan Guner | last post by:
Hi all, Here is the problem, i'm using Microsoft.XMLHTTP for ie and XMLHttpRequest for mozilla, on my local server which is win2000 server i've no problem with that but when i uploaded the file...
8
by: rithish | last post by:
I am on IE 6. I was trying out a simple xmlhttp function that send GET/POST requests. However, IE throws an 'unspecified error' when I call the 'setRequestHeader' method. The function that I am...
1
by: Ike | last post by:
Ive copied an online example for writing out a php file, programmatically, then would like to re-display that data in a browswer window that automatically refreshes as the data file (getdata.php,...
5
by: Prasad | last post by:
Hi all, I wanted to know whether my page is connecting to server or not using xmlHttp request. For that , I am using one condition in onreadystatechange function as.. function xxx() {...
14
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code>...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.