Forum Moderators: open

Message Too Old, No Replies

Ajax newsletter box

Permission denied to call method XMLHttpRequest.open

         

madmatt69

3:56 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all,

Pretty new to playing around with Ajax, and I'm trying to make a newsletter box.

So, when someone puts in their email address the script will the the submission in the background, and refresh the box to say its been successful or not, without having to load another page.

I basically have it working, but when it does the submission I get this error:
"Permission denied to call method XMLHttpRequest.open"

From what I've read it seems like its a sexurity measure. I use aweber for my newsletter, so I guess where it's having this problem is that the email address gets submitted to a third party site, and that's not allowed.

Is there a way around this? I was thinking if ajax passes the form variables to maybe a php script or something which then contacts the newsletter server.

Or, maybe another approach entirely?

Thanks for any input!

eelixduppy

8:21 pm on Feb 5, 2008 (gmt 0)



Are you accessing this file locally on your computer through Mozilla? I believe that is where your problem is. You can try to add the following code at the beginning of your code to see if that fixes it:

try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
} catch (e) {
alert("Permission UniversalBrowserRead denied.");
}

See if that helps :)

madmatt69

10:20 pm on Feb 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Right on.

Actually I just decided what i'll do is just put the code in an iframe, and it achieves the same effect I was going for.

Thanks, i'll use your code in the future!

eelixduppy

10:23 pm on Feb 5, 2008 (gmt 0)



Glad you got it :)