CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   Allow Ajax request cross domain? (http://www.codingforums.com/showthread.php?t=216278)

jarv 01-25-2011 12:39 PM

Allow Ajax request cross domain?
 
Hi,

I have searched and searched...

Is there a way of using the Ajax httpRequest cross domain?

thanks

Philip M 01-25-2011 02:06 PM

Quote:

Originally Posted by jarv (Post 1044888)
Hi,

I have searched and searched...

Is there a way of using the Ajax httpRequest cross domain?

thanks

No. For security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.


All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

jarv 01-25-2011 02:37 PM

I was told that I can buy a program that allows it from here: http://www.ajax-cross-domain.com/

hmm...

Also, someone else said I can build a Proxy?!

Philip M 01-25-2011 04:38 PM

Quote:

Originally Posted by jarv (Post 1044921)
I was told that I can buy a program that allows it from here: http://www.ajax-cross-domain.com/

Sure - but the operative word is buy. That program is written in Perl and outputs its content as a JavaScript file. That works around the "same origin" policy.

jarv 01-25-2011 04:50 PM

thanks, might use JSON

oesxyl 01-25-2011 04:57 PM

Quote:

Originally Posted by jarv (Post 1044888)
Hi,

I have searched and searched...

Is there a way of using the Ajax httpRequest cross domain?

thanks

in some condition:

http://www.w3.org/TR/cors/

best regards

rnd me 01-25-2011 08:26 PM

all browsers since IE8 support cross-site ajax. JSON can't do anything that xml can, though JSONp is potential solution.


All times are GMT +1. The time now is 11:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.