Hi,
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 https://wwww.myserver.xyz.com.I need to call other sever which URL ends with same as my server “xyz.com “(https://wwww.otherserver.xyz.com)
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,
Saravanan
Sample Code:
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 https://wwww.myserver.xyz.com.I need to call other sever which URL ends with same as my server “xyz.com “(https://wwww.otherserver.xyz.com)
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,
Saravanan
Sample Code:
Code:
function loadResponse()
{
//This my sever where html and js files are hosted
//https://wwww.myserver.xyz.com;
//need to call other sever which URL ends with same xyz.com
var url = 'https://wwww.otherserver.xyz.com'
document.domain ='xyz.com';
new Ajax.Request(url,
{
method:'get', onSuccess: function(transport)
{
response = transport.responseText || "no response text";
parseResponse();
},
onFailure: function()
{
parseAlternativeResponse();
}
});
}
Comment