| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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: 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)
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated!
Last edited by nasaboy007; 07-27-2008 at 11:31 AM.
Reason: Solved
|
| |
| | #2 (permalink) |
| NamePros Member Join Date: Sep 2006
Posts: 99
![]() ![]() | 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 |
| |
| | THREAD STARTER #3 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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.
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |
| | THREAD STARTER #4 (permalink) |
| Senior Member Join Date: Jul 2005 Location: NJ
Posts: 1,219
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Found the solution and edited my first post with the answer for those who might have the same/similar question. Thanks everyone.
__________________ Hacksar.com - Your source for random computer tips and tricks! MySiteMemberships.com - Keep track of your site registration information! Like my post? Rep is appreciated! |
| |