/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] AJAX: NS_ERROR_DOM_BAD_URI error all of a sudden?

Hi guys,

I’ve been using ajax for a little while. I have a page running very basic ajax. All of a sudden, I get this javascript error when running the page (viewed with FireFox error console): uncaught exception: [Exception… “Access to restricted URI denied” code:”1012″ nsresult:”0x805303f4 (NS_ERROR_DOM_BAD_URI)” locatation… ajax.js line 87

Here is the line 87: this.xmlhttp.open(this.method, totalurlstring, true);

The oddest part of this is that it worked fine just yesterday. I wake up this morning, run the page, and all of a sudden I get this error. I haven’t change anything to the page since yesterday when it was working well.

Anybody can give me a clue of what is happening?

Thank you very much!

Dominic

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@ZeroKilledOct 24.2008 — 
Exception... "Access to restricted URI denied" code:"1012" nsresult:"0x805303f4 (NS_ERROR_DOM_BAD_URI)" locatation... ajax.js line 87

i has not worked very deep on XHR but according to that error it seem you are trying to access a different domain than the yours. that is against the rule of origin policy. try to find out what totalurlstring evaluate to and check if it have the same domain or not.
Copy linkTweet thisAlerts:
@UnKnoWauthorOct 24.2008 — wow thanks that was it!!!

my xml was pointing to http://mydomain.com and I was trying to view the page from http://www.mydomain.com
I still can't believe it's considered not the same domain!

Anyways, thanks again very much!
Copy linkTweet thisAlerts:
@yashavantbFeb 23.2010 — Hi,

I am new to ajax. i am running some sample example in it. it was running file till yesterday and all of sudden i am getting error as 'Access to restricted URI denied" code: "1012'.

I read on forum that when anybody change the domain then this kind of error comes, but in my case i maintain the same domain.

I am getting error at line : page_request.open('GET', url+, true)

and url is pointing to 'http://google.co.in'.

Can anybody give me any pointers?

Thanks
Yash
×

Success!

Help @UnKnoW spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.26,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...