How to preserve jQuery.ajax.data object when using closure compiler?
When using closure compiler with ADVANCED_OPTIMIZATIONS, jQuery.ajax.data object is changed:
$.ajax({
type: "POST",
url: "ajax.php",
data: {
act : "some"
},
success : function(data){}
});
jQuery.ajax.data object is converted to {L : "开发者_运维百科some"}
I can use quotes, like 'act' : "some"
, but I want this to work without quotes.
In my externs file there is:
/** @type {Object.<string,*>} */
jQuery.ajax.data;
But this doesn't work. Closure compiler version 1043
Try the externs with something like :
var jQuery = {};
jQuery.ajax = {
data: ''
}
This will not rename 'jQuery.ajax' and 'jQuery.ajax.data'
精彩评论