Search the web
Sign In
New User? Sign Up
AJAX_2-0 · AJAX 2.0 = XHTML DOM + Remote JavaScript
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
How to make AJAX request between different domains??   Message List  
Reply | Forward Message #133 of 136 |
Re: How to make AJAX request between different domains??

Hi All,
I found the solution myself.Here is a summary of what I have done:-
I have a tomcat and Jboss installed on two different machines.I am
making a call from a web application deployed on tomcat to a web
service deployed on JBoss App Server.
This is not possible through AJAX because XMLHttp doesnt allow you to
make ajax calls between different domains.
There is a little known javascript trick called script tag monkeying
where you insert javascript from one domain to another domain.Through
this technique we can make javascript calls between different domains.
Below mentioned link is a very good link to understand this concept.

http://www.javaworld.com/javaworld/jw-11-2006/jw-1115-json.html?page=2

The implementation provided on javaworld is based on JSON but this
implementation is possible without JSON as well.

Let me know should you need any more help.

Thanks









--- In AJAX_2-0@yahoogroups.com, Jeff Woodman <sanctumvoid@...> wrote:
>
> My understanding is that most browsers won't allow cross-domain
ajax requests as a security precaution - some may allow you to
disable that, I dunno.
>
> One thing I've done in the past is develop a server-side proxy that
would exist (i.e.) on abc.com and act as a go-between between abc's
AJAX scripts and xyz's xml response.
> -Jeff
>
> http://www.sanctumvoid.net
>
>
>
> ----- Original Message ----
> From: krishnakumar_08 <krishnakumar_08@...>
> To: AJAX_2-0@yahoogroups.com
> Sent: Monday, August 13, 2007 11:21:43 AM
> Subject: [AJAX_2-0] How to make AJAX request between different
domains??
>
> Hi,
> I am working on an application where I am reuired to make AJAX
calls
> between different domains.Below is the summary of my problem:
>
> Say there is a domain
> abc.com
> there is another domain called
> xyz.com
>
> I want to make AJAX calls from abc.com to
> xyz.com
> ============ ========= ========= ========= ========= =======
> Sample code would be:
> (this will be contained in any page of abc.com)
> var url = "xyz.com?strCriteri a=testcriteria" ;
> if (window.XMLHttpRequ est) {
> req = new XMLHttpRequest( );
> } else if (window.ActiveXObje ct) {
> req = new ActiveXObject( "Microsoft. XMLHTTP") ;
> }
> req.open("GET" , url, true);
> req.onreadystatecha nge = callback;
> req.send(null) ;
> ============ ========= ========= ========= ========= ======
>
> When I do this it gives me "Access is denied".
> How do I do that?
> Please suggest any AJAX or non AJAX solution.
>
>
>
>
>
>
>
______________________________________________________________________
______________
> Moody friends. Drama queens. Your life? Nope! - their life, your
story. Play Sims Stories at Yahoo! Games.
> http://sims.yahoo.com/
>





Tue Aug 14, 2007 7:19 pm

krishnakumar_08
Offline Offline
Send Email Send Email

Forward
Message #133 of 136 |
Expand Messages Author Sort by Date

Hi, I am working on an application where I am reuired to make AJAX calls between different domains.Below is the summary of my problem: Say there is a domain ...
krishnakumar_08
Offline Send Email
Aug 13, 2007
5:58 pm

My understanding is that most browsers won't allow cross-domain ajax requests as a security precaution - some may allow you to disable that, I dunno. One thing...
Jeff Woodman
sanctumvoid
Offline Send Email
Aug 13, 2007
9:12 pm

Hi All, I found the solution myself.Here is a summary of what I have done:- I have a tomcat and Jboss installed on two different machines.I am making a call...
krishnakumar_08
Offline Send Email
Aug 14, 2007
7:19 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help