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

--- Comment #5 from Krinkle <[email protected]> ---
(In reply to Barry Coughlan from comment #2)
> The crossDomain logic will switch between the 'script' and 'xhr' transports,
> but both requests will still have be JSONP and have the callback parameter.
> 
> See here: http://jsfiddle.net/yvzSL/228/
> 
> In your developer tools console you can see that the local request uses XHR,
> but it is still a JSONP request over XHR. I have read through the $.ajax
> docs a number of times now and I see no indication that it should behave
> otherwise.

You read wrong. &callback= (or rather s.jsonpCallback) is only applied when the
"jsonp" transport is activated (builds on top of the "script" transport).

And the "json" dataType only activates "json" in case of crossDomain.

Making a plain api request to a non-crossdomain url does NOT result in a
callback parameter. Instead it results in a plain JSON response that is parsed
by JSON.parse, no callback or javascript execution comes into play.

MediaWiki core uses $.ajax in this in many places. For example
mediawiki.user.js[1] uses it to fetch user rights and groups information from
the API. This behaviour has been this way for quite a while.

Like I said, if VisualEditor and/or your wiki is doing it differently, there is
most likely a bug in the code invoking $.ajax.


[1]
https://github.com/wikimedia/mediawiki-core/blob/08c17086e1/resources/src/mediawiki/mediawiki.user.js#L27-L41

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

Reply via email to