Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax request returns 0x80004005 (NS_ERROR_FAILURE)

Tags:

jquery

I want to make an request from

webapp.mysite.net

to

mysite.net/request.php?param=...

The response is plain text. But I keep getting an error

enter image description here

The async param must be set to false.

I assume my request is called cross-domain request. So I setup a simple php proxy to solve the problem, but this does not work for me. It gives me an emtpy response.

I try to solve this problem for about two days now but without success. Any ideas?

like image 250
UpCat Avatar asked Feb 28 '11 12:02

UpCat


2 Answers

Ok,

I had a similar problem when making ajax Requests to the same domain and same level.

Don't make ajax request to

http://www.site.com

use

http://site.com

No idea why this is triggering this error, maybe somebody else will have this problem.

like image 193
Robert Avatar answered Oct 27 '22 10:10

Robert


I don't know whether the smsflatrate.net supports JSONP but this is what you'd have to use to get cross domain JSON request. But if I were you I probably wouldn't post your appkey and in public like you just did.

To use a proxy you have to have it on the same domain as you serve your HTML from, or use JSONP.

Also, why do you use async: false with callbacks? The only effect will be completely blocking the browser while the request takes place. And JSONP or any cross-domain requests can only be asynchronous.

like image 22
Zed Avatar answered Oct 27 '22 09:10

Zed