You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 25, 2023. It is now read-only.
I encountered a problem using the fileupload component in IE8 with angular. I did not completely isolated the problem, but tracked it back and solved it in our implementation.
_initDataAttributes: function () {
var that = this,
options = this.options;
// Initialize options set via HTML5 data-attributes:
$.each(
$(this.element[0].cloneNode(false)).data(),
function (key, value) {
if (that._isRegExpOption(key, value)) {
value = that._getRegExp(value);
}
options[key] = value;
}
);
},
In IE8, jquery's data() returns not only data-attributes, but also angulars $scope and the blueimpfileupload itself.
When a file is uploaded, the options object, now containing $scope is deep copied, which results in a stack overflow since $scope contains circular references.
Somehow this only occurred on the second subsequent upload, not on the first. I did not find out why, as the solution below resolves the problem anyway.
I resolved the problem by checking whether the returned fields from data() are actually data-attributes:
_initDataAttributes: function () {
var that = this,
options = this.options;
// Initialize options set via HTML5 data-attributes:
var clone = $(this.element[0].cloneNode(false));
$.each(
clone.data(),
function (key, value) {
if (clone[0].getAttribute('data-'+key)) {
if (that._isRegExpOption(key, value)) {
value = that._getRegExp(value);
}
options[key] = value;
}
}
);
},
The text was updated successfully, but these errors were encountered:
rikkertkoppes
pushed a commit
to rikkertkoppes/jQuery-File-Upload
that referenced
this issue
Feb 12, 2014
I encountered a problem using the fileupload component in IE8 with angular. I did not completely isolated the problem, but tracked it back and solved it in our implementation.
The problem lies in the following bit: https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.fileupload.js#L1308
In IE8, jquery's
data()
returns not only data-attributes, but also angulars$scope
and the blueimpfileupload itself.When a file is uploaded, the options object, now containing $scope is deep copied, which results in a stack overflow since $scope contains circular references.
Somehow this only occurred on the second subsequent upload, not on the first. I did not find out why, as the solution below resolves the problem anyway.
I resolved the problem by checking whether the returned fields from
data()
are actually data-attributes:The text was updated successfully, but these errors were encountered: