https://bugzilla.wikimedia.org/show_bug.cgi?id=64822

--- Comment #1 from Krinkle <krinklem...@gmail.com> ---
There is most certainly logic in $.ajax to switch between xhr/json and
script/jsonp. This has been in jQuery for many years.

The reason it isn't working might be related to the usage of protocol-relative
urls, or the presence of CORS support.

To cite the relevant parts:

    // A cross-domain request is in order when url parts mismatch
    if ( s.crossDomain == null ) {
        parts = rurl.exec( s.url.toLowerCase() );
        s.crossDomain = !!( parts[ 1 ] !== ajaxLocParts[ 1 ] || .. );
    }
    ..
    jQuery.ajaxTransport( "script", function(s) {
        // This transport only deals with cross domain requests
        if ( s.crossDomain ) {
            ..
        }
    });
    ..
    if ( xhrSupported ) { jQuery.ajaxTransport(function( s ) {
        if ( !s.crossDomain .. ) {
            return { send: function() {
                var xhr = s.xhr();
                ..
    ..

Anyway, no work around is needed. It is a well-known feature of $.ajax, we just
need to start using it. And if it isn't working, find out what we're doing
wrong on our end.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to