how to implement cross domain

Re: how to implement cross domain

Postby priya » Mon Dec 23, 2013 4:27 am

Hi,

Sorry. I am not getting the solutions yet. I will clearly explain my issue with example. Using the ajax call i am calling one url in a function.

function getadv(){
var url;
$.ajax({
type: "GET",
url: "www.staging.com/MPFullScreenAds?date=2013-10-31&resolution=1080p",
async: false,
success: function(message){
var url=message.data.url;
}

});
vid_samp_url(url);
}

Using the first ajax call i am getting the xml url which i have to parse as the url for the second ajax call. I am getting the xml url dynamically. My application hosted server and the first ajax url are in the same server.

function vid_samp_url(xml_url){
$.ajax({
type:"GET",
url: xml_url,
async: false,
success: function(xml){
console.log("xml call succeed");
vid_url=$(xml).find("MediaFiles").text();
}
}
From the second ajax i have to get the video path but it is not calling the xml url which is in the another server. I am not using php in my app.

Can you please help me in this
priya
 
Posts: 16
Joined: Sun Aug 25, 2013 10:53 pm

Re: how to implement cross domain

Postby Support_STA » Mon Dec 23, 2013 6:48 am

The problem may be that you are using jQuery version 1.8 or newer in which synchronous ajax calls are deprecated. Please review the jQuery.ajax () documentation for the async property. A solution could be to move the call to vid_samp_url into the success function of getadv and setting async to true or removing it.

Please avoid synchronous requests, as they may potentially hang the browser for a long time.

Regards,
STA QA
Support_STA
 
Posts: 136
Joined: Fri Aug 09, 2013 3:56 am

Previous

Return to App development questions



cron