Commit a2db4e04 by Borales

Fix for multiple $.ajax calls with "JSONP" dataType (related to #2417)

parent 9db3790b
...@@ -236,6 +236,9 @@ yii = (function ($) { ...@@ -236,6 +236,9 @@ yii = (function ($) {
return this.src.charAt(0) === '/' ? hostInfo + this.src : this.src; return this.src.charAt(0) === '/' ? hostInfo + this.src : this.src;
}).toArray(); }).toArray();
$.ajaxPrefilter('script', function (options, originalOptions, xhr) { $.ajaxPrefilter('script', function (options, originalOptions, xhr) {
if(options.dataType == 'jsonp') {
return;
}
var url = options.url.charAt(0) === '/' ? hostInfo + options.url : options.url; var url = options.url.charAt(0) === '/' ? hostInfo + options.url : options.url;
if ($.inArray(url, loadedScripts) === -1) { if ($.inArray(url, loadedScripts) === -1) {
loadedScripts.push(url); loadedScripts.push(url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment