Re: Using XMLHttpRequest in Firefox
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Mon, 23 Jan 2006 14:44:45 +0100
Trevor L. wrote:
But, won't it only open XML which is at the same site,
Yes, as said client-side script in browsers is restricted by same origin policy, that holds for Mozilla and Opera as well as for IE, you will get a permission denied exception with Mozilla on the open call, check Mozilla's JavaScript console. Opera 8 gives a security violation exception in its JavaScript console. IE gives a permission denied error dialog (if configured to display script errors/exceptions).
so I have to mess with it?
Then go ahead and mess with the code by doing unrelated things like document.onreadystatechange checks. But your script won't gain any permissions that way.
At the risk of being repetetive, the code below works in IE6, but not in Firefox.
IE has different zones which can be configured in terms of security so it might be that you load the document with the script in a zone like the trusted site zone or the local zone where settings are changed to allow access to other origins. But with normal settings for the internet zone IE will give you permission denied as well if you try to load XML from e.g. http://abc.net.au/ while your document with the script is from another internet origin.
--
Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ .
- Follow-Ups:
- Re: Using XMLHttpRequest in Firefox
- From: Trevor L.
- Re: Using XMLHttpRequest in Firefox
- References:
- Using XMLHttpRequest in Firefox
- From: Trevor L.
- Re: Using XMLHttpRequest in Firefox
- From: Martin Honnen
- Re: Using XMLHttpRequest in Firefox
- From: Trevor L.
- Re: Using XMLHttpRequest in Firefox
- From: Martin Honnen
- Re: Using XMLHttpRequest in Firefox
- From: Trevor L.
- Using XMLHttpRequest in Firefox
- Prev by Date: Re: what his line of code does?
- Next by Date: "Loading Window" page
- Previous by thread: Re: Using XMLHttpRequest in Firefox
- Next by thread: Re: Using XMLHttpRequest in Firefox
- Index(es):