I created this generic AJAX Handler to work with Firefox and IE. However, it seems that somewhere in updating Firefox to 2.0.0.9 that the handler assigned to onreadystatecha nge is no longer getting called. This still works for IE.
Can someone help me add to this so that I can get it working with Firefox again? -
var ASYNCH = true;
-
var REQUEST_TYPE = 'POST';
-
var AJAX_URL = '/ajax.cgi';
-
-
function httpRequest() {
-
// Mozilla-based browsers
-
if (window.XMLHttpRequest) {
-
ajaxRequest = new XMLHttpRequest();
-
}
-
// IE-based browsers
-
else if (window.ActiveXObject) {
-
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
-
-
if(! this.ajaxRequest) {
-
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
-
}
-
}
-
// The request could still be null if neither ActiveXObject
-
// initialization succeeded
-
if (! ajaxRequest) {
-
alert("Your browser does not permit the use of all of this " +
-
"application's features");
-
return false;
-
}
-
ajaxRequest.onreadystatechange = this.handler; // DOES NOT WORK IN Firefox 2.0.0.9
-
ajaxRequest.open( REQUEST_TYPE, AJAX_URL, ASYNCH);
-
ajaxRequest.setRequestHeader("Content-Type",
-
"application/x-www-form-urlencoded; charset=UTF=-8"
-
);
-
ajaxRequest.send( this.queryString );
-
return true;
-
}
5 2150 acoder 16,027
Recognized Expert Moderator MVP
Could you post the code for the handler?
Could you post the code for the handler?
I think I did not make myself clear, the handler never gets called in Firefox. It works perfectly in IE and it HAD worked in Firefox before I upgraded it. So it is something specific to recent versions of Firefox.
I was hoping someone could help add some code to handle the problem that is occurring specifically to Firefox.
gits 5,390
Recognized Expert Moderator Expert
hi ...
have a look at the FF javascript-console ... are there any errors?
kind regards
Friends, try remove the code line follow:
ajaxRequest.onr eadystatechange = this.handler;
I tried it, and this works perfectly at the FF, Chrome and IE 6, 7 and 8.
Kind regards.
gits 5,390
Recognized Expert Moderator Expert
then there is no response-handler?? how ist the response handled now? this.handler in the original post had to be a handler-function which would have been to be declared for the custom httpRequest function/object ... and it is missing in the posted code ... at least there should be something like: - ajaxRequest.onreadystatechange = function(response) {
-
// do something with response
-
};
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Clarence Gardner |
last post by:
I'm seeing surprising behavior, consistent across Opera, Firefox, and IE.
An event handler is changing the value of an element, and there is apparently
no Change event being generated for the element. A simple illustration is,
make an INPUT element with an onchange; type in a new value, the Change
event handler is called. But make a button whose Click handler changes the
value, and the Change handler does not get called.
It appears that...
|
by: cjl |
last post by:
Hey all:
I'm trying to write a cross-browser (IE and firefox) event handler for
the mousewheel. Basically my web app is an image viewer, so if you
scroll "down" with the wheel the next image should be displayed and if
you scroll "up" the previous image should be displayed.
So far I have:
function handleMouseWheel(e)
|
by: jeff29_b |
last post by:
I am having a strange problem on a web form. I have an image button
with an OnClick event handler. When I click the image the event isn't
being called in the code behind when browsing in firefox. I get the
postback but I never have the event called. It works fine in i.e.
|
by: wASP |
last post by:
Hi,
I'm having a problem referencing the elements within an object
after a method of that object (a member function) has been activated
with an onsubmit handler:
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
<script language="javascript" type="text/javascript">
function js_onsubmit_hndl_fn ()
{
|
by: David McNerney |
last post by:
Would anyone be able to tell me why I get an error in FireFox 1.5.0.1
for MacOSX when I type some text and hit Enter in the following form:
<html>
<body>
<form action="http://example.com" onSubmit="return false;">
<input type="text" name="samplenum" value=""
onChange="alert('onChange fired');">
<input type="submit" name="cmd_submit" value="Submit"
onClick="return false">
| |
by: petermichaux |
last post by:
Hi,
I thought it is about time I tried writing some JavaScript with
XMLHttpRequest instead of just using the Yahoo! UI library. The simple
page below works in both Safari and Opera but I don't see the alert in
Firefox. Looking in Firefox's firebug plugin, I see that the request is
successfully sent and the correct response is received. Any ideas what
is wrong?
Thank you,
|
by: VAXman- |
last post by:
I have code which is created from a content mamagement system. It places
some handlers on tags with in-line registration:
<tag... onmousedown="mousedownHandler(this);" ...>
I want to modified the handler and access the event. Here's an example of
such (very contrived example):
fucntion mousedownHandler(obj) {
|
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= |
last post by:
Note: My apologies for repeating this post from last week, but my nospam
alias and profile account were incorrect. I think I have fixed this, so
hopefully this post will trigger MS into a response per their MSDN policy.
--------------------
I have a web site under .NET 2.0 that renders videos using the Silverlight
media player.
The web page looks like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="video2.aspx.cs"
|
by: wolverine |
last post by:
Hi All,
In Mozilla Firefox, to onblur and onfocus event of each and every
html element, the browser itself will attach a native event handler. I
mean if you type, 'javascript:alert(window.blur)' in the address bar
of Firefox browser, you can see a 'function ....' . That is a Firefox
browser defined handler.
Now assume that web developer also attach event handlers to 'onblur'
events eg: 'window.blur=f3()'
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |