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

permission denied?

Hi,

I'm trying to use the xmlHttpReq object to contact a URL on my server.
But I'm getting a JS "Permission denied" error at the indicated line.
What does it mean and how can I get around it?

function signUp(signUpElt) {
if (!ValidEmail(signUpElt.value)) {
alert("Please enter a valid email address.");
return;
} // if

var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
var strURL =
"http://mydomain.myhost.com/add_email_response.php?EmailP=" +
escape(signUpElt.value);
self.xmlHttpReq.open('GET', strURL, true); // throws
"Permission denied" JS error.
Thanks for any help, - Dave

Oct 24 '06 #1
2 4520
VK

la***********@zipmail.com wrote:
I'm trying to use the xmlHttpReq object to contact a URL on my server.
But I'm getting a JS "Permission denied" error at the indicated line.
"http://mydomain.myhost.com"

is this line (it's real representation I mean) *identical* to the
corresponding part of the URL where your script is located?

For example
http://somedomain.myhost.com
and
http://otherdomain.myhost.com
are not the "same" in the cross-domain lock sense.

Oct 24 '06 #2
ASM
la***********@zipmail.com a écrit :
Hi,

I'm trying to use the xmlHttpReq object to contact a URL on my server.
But I'm getting a JS "Permission denied" error at the indicated line.
What does it mean
do you request to same domain your file is ?

if not : you can't do that -permission denied !

if yes :
what does do this 'self' in :
self.xmlHttpReq.open(
what do you expect ?

xmlHttpReq.open() open connexion to desired file (not much more)

then, latter, on server's answer you'll treat the responseText

var http_request;

function signUp(signUpElt) {
if (!ValidEmail(signUpElt.value)) {
alert("Please enter a valid email address.");
return;
}
http_request = false;
// Mozilla/Safari
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
var strURL="http://mydomain.myhost.com/add_email_response.php?EmailP="+
escape(signUpElt.value);
http_request.onreadystatechange = function() { showContents(strURL) };
http_request.open('GET', strURL, true);
http_request.send(null);
}

function showContents(url) {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
var req_content = http_request.responseText;
document.getElementById('content').innerHTML = req_content;
}
else {
alert('Something wrong with this request.');
if(confirm('Do I try to open the new page?'))
location.href=url;
}
}
}
--
ASM
Oct 24 '06 #3

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

Similar topics

1
by: Klunk | last post by:
Hi, last week I moved the folder of my Intranet application to another disk of the same server. After this change all the ASP page return this error: Microsoft VBScript runtime error...
6
by: Jon Montana | last post by:
CDONTS was working well until I installed Exchange 2000. I thought it might be a relay problem, but I allowed the server IP address to relay. Thanks for anything you can offer. here's the...
1
by: Mark E. Hamilton | last post by:
Sorry, I probably should have re-stated the problem: We're using Python 2.3.5 on AIX 5.2, and get the follow error messages from some of our code. I haven't yet tracked down exactly where it's...
10
by: Florian G. Pflug | last post by:
Hi I installed a postgres-application (which was developed on debian woody) on red hat 9 today, using the postgres 7.3 rpms from redhad. One of my the triggers uses the pg_settings table (more...
2
by: Taishi | last post by:
New user of SQL Everything is on the same machine My error is close to the bottom After reading it today, I can see there is a problem with 2 dbases 'PUBS' and 'Master' There are also some...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
0
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to...
0
by: private.anders | last post by:
Hi David! Really need assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
0
by: private.anders | last post by:
Really need your assistance since I have been struggling with a problem long time now. I am running a web application on a Win 2003 Std (Active Directory). Everything works fine. I have...
4
by: xzzy | last post by:
I have a v1.1 web app that works on my local computer. However, running it at the host computer, the following breaks: when a viewer selects a different country, the State dropdown should...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.