Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-25-2011, 12:39 PM   PM User | #1
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
Question Allow Ajax request cross domain?

Hi,

I have searched and searched...

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

thanks
jarv is offline   Reply With Quote
Old 01-25-2011, 02:06 PM   PM User | #2
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by jarv View Post
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.
Philip M is offline   Reply With Quote
Old 01-25-2011, 02:37 PM   PM User | #3
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
Question

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?!
jarv is offline   Reply With Quote
Old 01-25-2011, 04:38 PM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,036
Thanks: 197
Thanked 2,411 Times in 2,389 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by jarv View Post
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.
Philip M is offline   Reply With Quote
Old 01-25-2011, 04:50 PM   PM User | #5
jarv
Banned

 
Join Date: Mar 2007
Posts: 1,523
Thanks: 116
Thanked 0 Times in 0 Posts
jarv can only hope to improve
thanks, might use JSON
jarv is offline   Reply With Quote
Old 01-25-2011, 04:57 PM   PM User | #6
oesxyl
Master Coder


 
Join Date: Dec 2007
Posts: 6,682
Thanks: 436
Thanked 890 Times in 879 Posts
oesxyl is a jewel in the roughoesxyl is a jewel in the roughoesxyl is a jewel in the rough
Quote:
Originally Posted by jarv View Post
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
oesxyl is offline   Reply With Quote
Old 01-25-2011, 08:26 PM   PM User | #7
rnd me
Senior Coder

 
rnd me's Avatar
 
Join Date: Jun 2007
Location: Urbana
Posts: 3,455
Thanks: 9
Thanked 466 Times in 450 Posts
rnd me is a jewel in the roughrnd me is a jewel in the roughrnd me is a jewel in the rough
all browsers since IE8 support cross-site ajax. JSON can't do anything that xml can, though JSONp is potential solution.
__________________
my site (updated 5/13)
STATS (2013/5) HTML5:90.2% MOB:14% IE7:0.5% IE8:8.6% IE9:9.8% IE10:10%
rnd me is offline   Reply With Quote
Reply

Bookmarks

Tags
ajax, cross, domain, request

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:01 PM.


Advertisement
Log in to turn off these ads.