473,416 Members | 1,698 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,416 software developers and data experts.

HTTPRequest and Same Origin Policy

Is the HTTPRequest Object in IE limited to the Same Origin Policy when
run from a webserver?
<URL: http://www.hikksworld.com/HTTPRequestIE.html />
When run in IE, throws a "Permission Denied" error. When I run that page
locally, it works without errors. Which leads me to believe that its
Same Origin Policy coming in, since I can give it www.hikksworld.com
instead of www.google.com and it works from the server.
Or, is it just something that I am missing that would allow it to "work"
in IE from the server?

The Mozilla version I have, works locally or from the server.
<URL: http://www.hikksworld.com/HTTPRequestMoz.html />
It doesn't matter (once I give permission) in Mozilla what file I want
to read, it reads it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #1
2 2191


Randy Webb wrote:
Is the HTTPRequest Object in IE limited to the Same Origin Policy when
run from a webserver?
<URL: http://www.hikksworld.com/HTTPRequestIE.html />
When run in IE, throws a "Permission Denied" error. When I run that page
locally, it works without errors. Which leads me to believe that its
Same Origin Policy coming in, since I can give it www.hikksworld.com
instead of www.google.com and it works from the server.
Or, is it just something that I am missing that would allow it to "work"
in IE from the server?

The Mozilla version I have, works locally or from the server.
<URL: http://www.hikksworld.com/HTTPRequestMoz.html />
It doesn't matter (once I give permission) in Mozilla what file I want
to read, it reads it.

Your Mozilla version only throws errors for me with Netscape 7.1, and
looking at the code it appears you expect people to have codebased
principals enabled as otherwise the
netscape.security.PrivilegeManager.enablePrivilege call will simply fail
in a page loaded via http.

So both Mozilla and IE have the same origin policy for XMLHttpRequest
respectively Msxml2.XMLHTTP, with Netscape you need to successfully
request the privilege to be able to access files from other domains, and
IE can be configured to allow that in the security settings for the
internet zone, there is an option to allow access to data sources across
domains that can be enabled in general or set to prompt the user to
allow the access.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
Martin Honnen wrote:


Randy Webb wrote:
Is the HTTPRequest Object in IE limited to the Same Origin Policy when
run from a webserver?
<URL: http://www.hikksworld.com/HTTPRequestIE.html />
When run in IE, throws a "Permission Denied" error. When I run that
page locally, it works without errors. Which leads me to believe that
its Same Origin Policy coming in, since I can give it
www.hikksworld.com instead of www.google.com and it works from the
server.
Or, is it just something that I am missing that would allow it to
"work" in IE from the server?

The Mozilla version I have, works locally or from the server.
<URL: http://www.hikksworld.com/HTTPRequestMoz.html />
It doesn't matter (once I give permission) in Mozilla what file I want
to read, it reads it.


Your Mozilla version only throws errors for me with Netscape 7.1, and
looking at the code it appears you expect people to have codebased
principals enabled as otherwise the
netscape.security.PrivilegeManager.enablePrivilege call will simply fail
in a page loaded via http.

So both Mozilla and IE have the same origin policy for XMLHttpRequest
respectively Msxml2.XMLHTTP, with Netscape you need to successfully
request the privilege to be able to access files from other domains, and
IE can be configured to allow that in the security settings for the
internet zone, there is an option to allow access to data sources across
domains that can be enabled in general or set to prompt the user to
allow the access.


Many thanks Martin. When I first wrote that page, it was mostly for
personal use and a learning experience. Now, its on to learn how to do
that in PHP :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #3

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

Similar topics

3
by: HikksNotAtHome | last post by:
In Mozilla 1.4b, when the URL is set to a local URL, it works as expected. function showIt(){ var xmlhttp = new XMLHttpRequest(); xmlhttp.open("GET", "blank.html" ,true);...
4
by: Jon | last post by:
I have links that open https secondary windows using: window.open(url, windowName); The windowName is always the same but I keep getting new windows. Is it possible for each of the links to...
1
by: Mark Miller | last post by:
I just recently started getting the above error on a page I am posting MULTIPART/FORM-DATA. We have SoftArtisans FileUp component and Filter installed on the server in question and up until a day...
1
by: success_ny | last post by:
I cannot seem to find the answer to this rather simple question. Pardon me if it looks illogial or silly. Can I create a frame in the same page without referring to other html files? I.e., I...
4
by: Turko | last post by:
Hi all. I m searching for the equivalent of : try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); } catch (e) { alert("Permission UniversalXPConnect denied."); }
1
by: muskaran | last post by:
I am facing 'Cross Domain Security' within Frame.Its the 'Same Origin Policy ' issue. I have a frame which adjusts its height according to the height of the document.This works fine for all types...
1
by: Jeff | last post by:
ASP.NET 2.0 I'm about to program a HttpRequest from my asp.net 2.0 website. I'll request another server using HttpRequest and ask if password etc are okay.... So I've looked into the...
2
by: jackchang1 | last post by:
I had a web page hosted in one domain. In IE6 it is able to request data from another page in a different domain using XMLHttpRequest object. It fails in IE7/Firefox/Safari. Can you confirm that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
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...

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.