Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

Security Error Problem

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner

View previous topic :: View next topic  
Author Message

Joined: 11 Feb 2009
Posts: 1
Location: St. Cloud, MN

PostPosted: Thu 05 Mar '09 18:06    Post subject: Security Error Problem Reply with quote

I'm running Apache 2.2.10 on a SuSE Linux 11.1 box. It's DNS name is "labserver" and has an IP address of

I'm experimenting with the Dojo Toolkit and have run into a snag while working with some rudimentary AJAX functionality. Here's the HTML code for the "hello.html" file:

<title>Hello, Ajax World!</title>
<script type="text/javascript"
<script type="text/javascript">
function hello() {
   dojo.xhrGet( {
      url: "http://labserver/school/ajax.txt",
      handleAs: "text",
      timeout: 5000,
      load: function(response, ioArgs) {
         dojo.byId("cargo").innerHTML = response;
         return response;
      error: function(response, ioArgs) {
         console.error("HTTP status code: ", ioArgs.xhr.status);
         return response;
<script type="text/javascript">
<div id="cargo" style="font-size: big"></div>

When I use a Firefox browser, the code works as it's supposed to when I visit the URL "http://labserver/school/hello.html". However, if I attempt to visit the URL "" I get the following error messages in the Error Console:

Security Error: Content at may not load data from http://labserver/school/ajax.txt.


[Exception... "Access to Restricted URI denied" code:"1012" nsresult:"0x805303f4 (NS_ERROR_DOM_BAD_URI)" location:" Line:16"]

If I modify the "url:" value inside the "hello" function to read 'url: ""' then the behavior is reversed. That is to say that the URL "" works OK and the URL "http://labserver/school/hello.html" does not. The error messages show up in the Error Console with the various particulars reversed.

Now, it occurred to me while I was writing this that if I made sure that the "server" part of the URL matched the server part specified in the "url: value things would work out fine. But since I've come this far I'd like to know if there's anything in the Apache configuration that would allow for either to work. It has also just occurred to me that it could be something in the way JavaScript handles the URI.

In either case, a gentle "look, dummy, it's like this" would be appreciated.

Thanks in advance.
Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6460
Location: Germany, Next to Hamburg

PostPosted: Thu 05 Mar '09 18:21    Post subject: Reply with quote

That is because javascript polices does not allow scripting over different servers and or your sever can't resolve the name to the ip.
So you should use url: "", instead of
[b]url: "http://labserver/school/ajax.txt",
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1