NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page [resolved] AJAX "Access is Denied" Error

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 07-26-2008, 10:33 AM THREAD STARTER               #1 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



AJAX "Access is Denied" Error


I am attempted to make a firefox add-on that will send data to an external server (sort of like those stumbleupon and del.icio.us addons) with information about what page you're on. however, i want to do this with ajax rather than with forms. The info is populated with predefined variables and are populated with prompt / other info.

now, my problem is that since i'm trying to send the data to an external server, my ajax keeps returning an "access is denied" error. (i actually spent a really long time figuring that out - firefox didn't give any errors since it was an extension... i eventually had to make a new file of jus the ajax to test it in ie so i could see the exact error.)

i tried changing the chmod of the files on my server to 777 and i still got the access denied error. is there some way to get it to work?

or will i have to like open a new window with a page from my site and let them do their stuff there? (since thats what those social bookmarking sites seem to do... i think... but all of the windows look similar if not the same just a different header, so im not so sure).

thanks



EDIT:
I found the solution at
http://developer.mozilla.org/en/docs...XMLHttpRequest

All it took was adding:
PHP Code:
<?php header('Access-Control: allow <*>'); ?>
to my php file that was doing the processing.

However, i believe this only works for the newest browsers, but since I'm writing a firefox addon i can just make it for firefox 3.0+ (since this is what i believe it works on)
Last edited by nasaboy007; 07-27-2008 at 11:31 AM. Reason: Solved
nasaboy007 is offline  
Old 07-26-2008, 02:15 PM   #2 (permalink)
NamePros Member
Join Date: Sep 2006
Posts: 99
Bruce_KD will become famous soon enoughBruce_KD will become famous soon enough
 



I have never worked with Firefox addons.
However, in conventional Browser JavaScript, you may only use Ajax to access a file in that site.

For example, a script on www.bruce.com couldn't open something from www.anothersite.com. Attempting to do so would throw a forbidden error.
(Interestingly enough, even calling http://bruce.com/file.php isn't possible from http://www.bruce.com/script.js. Even the subdomain must be the same.)
????: NamePros.com http://www.namepros.com/programming/496974-resolved-ajax-access-is-denied-error.html

Is there a chance that Ajax is not the tool you should be using? You may want to research different methods of Firefox addon data retrieval.


Bruce
Bruce_KD is offline  
Old 07-26-2008, 07:57 PM THREAD STARTER               #3 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



I see. Well, firefox addons are basically XML to make the menus, which call javascript functions with oncommand (aka onclick, etc). so i think the only way to do it would be with javascript... what other ways are there to send data to and from external servers since ajax won't work? i only know th ebasics of javascript, and am no pro.
nasaboy007 is offline  
Old 07-27-2008, 11:32 AM THREAD STARTER               #4 (permalink)
Senior Member
 
nasaboy007's Avatar
Join Date: Jul 2005
Location: NJ
Posts: 1,219
nasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud ofnasaboy007 has much to be proud of
 



Found the solution and edited my first post with the answer for those who might have the same/similar question.

Thanks everyone.
nasaboy007 is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 09:16 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger