Skip to main content

Bug Tracker

Side navigation

#14405 closed bug (duplicate)

Opened September 30, 2013 12:57PM UTC

Closed October 13, 2013 12:30PM UTC

jQuery.ajax behaves differently when solve the sourceMappingURL

Reported by: jeffrey.zksun@gamil.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

I use jQuery.ajax to load the javascript file cross domain. The script code are as below. There is only one difference between test1.html and test2.html. In test1.html, the dataType is set to be 'script', but not in test2.html. If the dataType is not specified, it will infers from the MIME type. For the test2.html, the inferred dataType is also 'script'.

In Test1.html, the chrome devTools tries to load source map from http://code.angularjs.org/1.2.0rc1/angular.min.js.map. But in Tet2.html, it tries to load the source map from http://local.host:8081/web/angular.min.js.map, which is incorrect. This is the defect.

In my test code, the only difference is specifying the dataType or inferring it. So it seems like a jQuery defect, which affect the solved path of the source mapping url. More details are post here: stackoverflow.com/questions/19079171/jquery-ajax-behaves-differently-when-solve-the-sourcemappingurl

Test1.html

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script>

$.ajax({

url: "http://code.angularjs.org/1.2.0rc1/angular.min.js",

type: "GET",

dataType: "script",

success: function(){

if(typeof angular !== undefined )console.log('evaluated');

else console.log('not evaluated');

},

error: function(){ console.log('failure')}

});

</script>

Test2.html

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script>

$.ajax({

url: "http://code.angularjs.org/1.2.0rc1/angular.min.js",

type: "GET",

success: function(){

if(typeof angular !== undefined )console.log('evaluated');

else console.log('not evaluated');

},

error: function(){ console.log('failure')}

});

</script>

Attachments (0)
Change History (1)

Changed October 13, 2013 12:30PM UTC by dmethvin comment:1

resolution: → duplicate
status: newclosed

Duplicate of #14404.