473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

AJAX works in IE6 but not IE7 or Firefox

I have an AJAX routine on a webpage that is working in IE6, but not IE7
or Firefox v2.0.0.2

The webpage is

http://www.a-drop-in-the-ocean.co.uk...php?quarry=401

The AJAX routine is encapsulated in the module

http://www.a-drop-in-the-ocean.co.uk/CWS/js/timer.js

What it is supposed to do is every ten seconds, read the contents of the
file http://www.a-drop-in-the-ocean.co.uk/CWS/401/seqno.txt. This file
just contains the number 46955. If this number changes then the page
will refresh.

The timer routine, counts down the 10 seconds, displaying the counter in
the top right hand corner. Once the counter hits zero, it triggers the
AJAX request.

The onload event also triggers the AJAX request to get the initial value
of the number.

I presume that IE7 and FF use the XMLHttpRequest() function and that I
must have coded this incorrectly. But what is wrong with it?

Interestingly, the firebug extension in FF, shows the request and
response headers along with the response 46955.

Fixing this is not critical at the moment as IE6 is our company
standard. But at some stage we will migrate to IE7...

Has anybody got any ideas?
--
Steve Wright
Mar 13 '07 #1
5 2669
Steve Wright wrote:
I have an AJAX routine on a webpage that is working in IE6, but not IE7
or Firefox v2.0.0.2

The webpage is

http://www.a-drop-in-the-ocean.co.uk...php?quarry=401

The AJAX routine is encapsulated in the module

http://www.a-drop-in-the-ocean.co.uk/CWS/js/timer.js

What it is supposed to do is every ten seconds, read the contents of the
file http://www.a-drop-in-the-ocean.co.uk/CWS/401/seqno.txt. This file
just contains the number 46955. If this number changes then the page
will refresh.

The timer routine, counts down the 10 seconds, displaying the counter in
the top right hand corner. Once the counter hits zero, it triggers the
AJAX request.

The onload event also triggers the AJAX request to get the initial value
of the number.

I presume that IE7 and FF use the XMLHttpRequest() function and that I
must have coded this incorrectly. But what is wrong with it?

Interestingly, the firebug extension in FF, shows the request and
response headers along with the response 46955.

Fixing this is not critical at the moment as IE6 is our company
standard. But at some stage we will migrate to IE7...

Has anybody got any ideas?
What is not working about it? The AJAX code looks like it should work
in both firefox and IE, so I don't think that's your problem.

I would guess off the top of my head that the response is getting cached
(despite sending if-modified-since) and so you're not getting back an
updated response. There are a lot of ways to prevent this, such as
using a POST request instead of GET and/or appending a randomized query
string.

Jeremy
Mar 13 '07 #2
Steve Wright wrote:
I have an AJAX routine on a webpage that is working in IE6, but not IE7
or Firefox v2.0.0.2

The webpage is

http://www.a-drop-in-the-ocean.co.uk...php?quarry=401

The AJAX routine is encapsulated in the module

http://www.a-drop-in-the-ocean.co.uk/CWS/js/timer.js

What it is supposed to do is every ten seconds, read the contents of the
file http://www.a-drop-in-the-ocean.co.uk/CWS/401/seqno.txt. This file
just contains the number 46955. If this number changes then the page
will refresh.

The timer routine, counts down the 10 seconds, displaying the counter in
the top right hand corner. Once the counter hits zero, it triggers the
AJAX request.

The onload event also triggers the AJAX request to get the initial value
of the number.

I presume that IE7 and FF use the XMLHttpRequest() function and that I
must have coded this incorrectly. But what is wrong with it?

Interestingly, the firebug extension in FF, shows the request and
response headers along with the response 46955.

Fixing this is not critical at the moment as IE6 is our company
standard. But at some stage we will migrate to IE7...

Has anybody got any ideas?
Hi,

go to: www.w3schools.com

Follow the AJAX link.
Read through it. It won't take more than 15 minutes if you are familiar with
JS.
You will find a nice routine at the end that gives you your xmlhttprequest
on all platforms that support it.

Regards,
Erwin Moller

PS: Shame your company isn't migrating to FF.

Mar 13 '07 #3
Steve Wright wrote:
>Has anybody got any ideas?
Your request.open call only has 2 parameters,

request.open ('get', url);

the docs for XMLHttpRequest for Mozilla/Firefox say it needs 3 -- and
last time I chaked, Firefox does indeed need the 3rd parameter.

req.open('GET', 'http://www.mozilla.org/', false);

<http://developer.mozilla.org/en/docs/XMLHttpRequest>

HTH

--
Bart.
Mar 14 '07 #4
On Mar 14, 7:06 pm, Bart Lateur <bart.lat...@pandora.bewrote:
Steve Wright wrote:
Has anybody got any ideas?

Your request.open call only has 2 parameters,

request.open ('get', url);

the docs for XMLHttpRequest for Mozilla/Firefox say it needs 3 -- and
last time I checked, Firefox does indeed need the 3rd parameter.

req.open('GET', 'http://www.mozilla.org/', false);

<http://developer.mozilla.org/en/docs/XMLHttpRequest>
Whilst you are correct, that is not the root cause of the problem.

I have changed the request.open to pass true as the 3rd parameter, but
this has no effect in Firefox.

(Please note I am trying this at work, so I haven't changed the
version I posted to the group yet - I'll do that tonight).

My next idea is to rewrite using the prototype library routines (if I
can get my head around them)

Mar 15 '07 #5
Steve Wright wrote:
> req.open('GET', 'http://www.mozilla.org/', false);

<http://developer.mozilla.org/en/docs/XMLHttpRequest>

Whilst you are correct, that is not the root cause of the problem.

I have changed the request.open to pass true as the 3rd parameter, but
this has no effect in Firefox.
While that may be true, in my haste, I got the value of the parameter
wrong. It is false for synchronous, and true for asynchronous mode. As a
note on the page says:

Note: This example works synchronously, so it will block the
user interface if you call this from your JavaScript. You should
not use this in practice.

--
Bart.
Mar 15 '07 #6

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

Similar topics

5
by: dougwig | last post by:
I'm trying to handle the scenario where a user's session times out and and their ajax request triggers a redirection by the webserver (302 error?). I'm using Prototype 1.4 and the my works great...
5
by: Danny R | last post by:
I have the following javascript which works in either IE or Firefox but not on both. When I set the code to http_request.open('POST', url, true) - Works in IE only http_request.open('GET',...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
3
by: noballack | last post by:
I've got a problem, I'm working with Ajax in a web with a form with a list of checkbox added to the form via an Ajax.Updater method. These added checkboxs are not been sended by the form if I use...
4
by: ext237 | last post by:
Simple ajax call seems to have some issues in Firefox. The "onComplete:" is called BEFORE the response is returned by the call. Is there a coding issue or a work around? var ajax = new...
0
by: jrnail23 | last post by:
I have a user control which contains an UpdatePanel, which contains a MultiView inside, with a GridView in one of the views. In my GridView, I have a ButtonField which is supposed to trigger a...
1
by: wpt394 | last post by:
I am running a code that works just fine in Firefox, but seems to have trouble in IE. The basic idea is that a travel search process is initiated with one ajax call, and a 2nd ajax call 'updates'...
2
by: burtonfigg | last post by:
I'm testing an ajax page - this works fine in Firefox: http://jimpix.co.uk/clients/a/ecards/defaultx.asp Click on any of the links on the right under the 'occassions' or 'others' headings, in...
3
by: George | last post by:
I am doing an AJAX call using JQuery on my page to which returns JSON objects and everything works fine. Now I decided to use ashx handler instead of and simply write JSON out. Then my problems...
7
by: mike57 | last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.