JQuery AJAX with two domains

Well, here is the situation: I have an external CMS system that works fine for 99% of our needs. However, on more advanced things, I add my own CSS + JS and do the magic. The problem I ran into is loading a simple HTML page from jQuery.ajax () calls. It seems to work in the sense that no warnings or errors occur; however, in my success handler (which was launched) the answer is empty!

I scratch my head all the time, trying to figure it out, and the only thing I can think of is what is related to the cross-domain problem (although it works).

JavaScript entered:

$(document).ready(function() {
    doui();
});
function doui() {
    $.ajax({
        url: 'http://apps.mydomain.com/css/feecalc/ui.htm',
        cache: false,
        success: ajax_createUI,
        charset: "utf-8",
        error: function(e) {
            alert(e);
        }
    });
}
function ajax_createUI(data, textStatus) {
    alert(data);
    $("#ajax-content").html(data);
}

My success handler ajax_createUI () is called, and textStatus is called success; however, the data is blank.

JS @http://apps.mydomain.com/css/js/feecalc.js, - CMS ( JS, ) @http://www.mydomain.com/

, , , , , ?

+5
3

, : . , , jsonp

+5

, - . load()

-, , . load() , .

: .load(/myPage.aspx) myPage.aspx http://apps.natronacounty-wy.gov/css/feecalc/ui.htm

+1

You could request your query through YQL (Yahoo! Query Language), which will lead to the creation of a JSONP file (it even supports XMLP → XML with a callback function). This may slow performance, but Yahoo provides fast servers.

0
source

All Articles