Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > permission denied?

Reply
Thread Tools

permission denied?

 
 
laredotornado@zipmail.com
Guest
Posts: n/a
 
      10-24-2006
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

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      10-24-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) 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.

 
Reply With Quote
 
 
 
 
ASM
Guest
Posts: n/a
 
      10-24-2006
(E-Mail Removed) 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed: The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {555F3418-D99E-4E51-800A-6E89CFD8B1D7} to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19). Skybuck Flying Windows 64bit 1 06-29-2009 06:17 PM
Permission Settings problems. Kardon Coupé Wireless Networking 7 03-08-2005 02:54 AM
WINXP SP2 ICON WIRELESS PERMISSION =?Utf-8?B?SnVhbiBDYXJsb3MgTXXDsW96?= Wireless Networking 0 02-08-2005 10:13 AM
Getting "You might not have permission to use this network..." err =?Utf-8?B?U29tZSBHdXk=?= Wireless Networking 2 01-09-2005 08:32 AM
Error Message - No permission to use this network resource - =?Utf-8?B?UGV0ZXI=?= Wireless Networking 3 12-13-2004 04:37 PM



Advertisments