I have a problem with div loading/fading.. This is my html.
<div id="email_response">
<div id="email_loader">
<img src="/img/ajax_load.gif.pagespeed.ce.sBYFmTTK7I.gif">
</div>
The jQuery:
$("#email_loader").html("<img src='http://example.com/img/ajax_load.gif' />");
$("#email_response").fadeIn(500);
$.get("http://example.com/inc_appdl_main_api.php", {
to : to,
app_id : FA.appID
}, function(data) {
if (data.length > 0) {
$("#email_loader").html(data);
$("#email_response").delay(1000).fadeOut(500);
}
});
setTimeout ( "FA.iframeClose()", 2000 );
The div email_response , should load/fadeIn for half a second..then the response should be obtained from jquery ..and then a the end an iframe that contains all the html markup should close..
Everything works apart from the code inside the get success function..
I know that the success function is actually triggered..cause the server (php) code, does what it does!!!
Whats the problem? I dont see the response fading out..
The code inside the success function doesnt work 🙁
if (data.length > 0) {
$("#email_loader").html(data);
$("#email_response").delay(1000).fadeOut(500);
}
UPDATE:
THIS IS WHAT I GET IN THE CONSOLE. AFTER THE GET FUNCTION IS TRIGGERED.
XMLHttpRequest cannot load http://example.com/inc_appdl_main_api.php?to=makovetskiyd%40yahoo.co.uk&app_id=81. Origin http://api.example.com is not allowed by Access-Control-Allow-Origin.
The html markup and javascript is in an iframe which has another site on it..
Access-Control-Allow-Origin. You are accessing something out of your domain? cross-domain-requests-with-jquery, cross-domain-ajax-querying-with-jquery