Re: Catching reload error
- From: David Mark <dmark.cinsoft@xxxxxxxxx>
- Date: Fri, 6 Feb 2009 16:49:12 -0800 (PST)
On Feb 2, 4:02 am, "Duncan McNiven" <NO_SPAM_dun...@xxxxxxxxxxx>
wrote:
RoLo wrote:
XMLHttpRequest can load the static HTML if its from the same origin.
https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript
OK, Good.
You could use the same data received by the XMLHttpRequest and change
the old one... without reloading..
OK. I do have full control over the data, so I can do whatever is
needed to get this working. It is disappointing (and surprising to me)
that IE cannot catch a failure in location.reload, but such is life I
guess.
Thanks a lot for the example code. I have tried it, and encountered a
couple of problems in the makeRequest routine. I can code around both
of them, but I'll note them here anyway. The test:
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
returns true when I run in IE. I expected it to be false. I can make
other tests to identify the browser, but this is odd.
You don't need to identify the browser, just remove the inaccurate
comment(s).
The other minor change is that I get an httpRequest.status of 0. I
Yes, local file.
found that is OK, in that I get 0 instead of 200 because I am dealing
with a file. If I test for 0 instead of 200 I can get the
httpRequest.responseText OK.
Anyway, thanks a lot for the help. I can now move forward from here.
I'll now take a look at implementing the replacement of the old data
with the new data.
Don't use that Ajax example verbatim as it will leak in IE. I wonder
how many times it has been copied and pasted over the years?
According to the comments, it predates IE7. No idea what the
overrideMimeType call is about either (use of that method is a hack.)
Also, I thought IE7's "native" version of XHR had an issue with local
file requests. If so, you will need to swap the order of the feature
tests (look for the ActiveX version first.)
.
- Follow-Ups:
- Re: Catching reload error
- From: Duncan McNiven
- Re: Catching reload error
- References:
- Catching reload error
- From: Duncan McNiven
- Re: Catching reload error
- From: RoLo
- Re: Catching reload error
- From: Duncan McNiven
- Re: Catching reload error
- From: RoLo
- Re: Catching reload error
- From: Duncan McNiven
- Catching reload error
- Prev by Date: Re: removeChild code wrong?
- Next by Date: Re: Calculate prices in a form
- Previous by thread: Re: Catching reload error
- Next by thread: Re: Catching reload error
- Index(es):
Relevant Pages
|