By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,373 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,373 IT Pros & Developers. It's quick & easy.

Cross domain calls issue in Firefox and Safari using AJAX

P: 1

I have implemented prototype.js file to use AJAX calls in my application. I need to call cross domain to get some value from different server. The HTML and prototype file are hosted in need to call other sever which URL ends with same as my server (

The below mentioned code is working fine only in IE browser, But it is not working in Firefox and Safari browsers.Could you please assist me?.Your help is very appreciated.

Thanks a lots,

Sample Code:

Expand|Select|Wrap|Line Numbers
  1.     function loadResponse()
  2.     {
  3.         //This my sever where html and js files are hosted
  4.         //;
  6.         //need to call other sever which URL ends with same
  7.         var url = ''
  9.         document.domain ='';
  11.         new Ajax.Request(url,
  12.         {
  13.             method:'get', onSuccess: function(transport)
  14.             {
  15.                 response = transport.responseText || "no response text";
  16.                 parseResponse();
  17.             },
  18.             onFailure: function()
  19.             {
  20.                 parseAlternativeResponse();
  21.             }
  22.         });
  24.     }
Oct 25 '08 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 16,027
See same origin policy. Is it four Ws and can it not be a single domain?
Oct 26 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.