I'm getting the following error:
[Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "http://code.jquery.com/jquery-1.9.1.js Line: 2257"]
I've tried to look up the code but I can't find what the exception is. Simply put I have an Angularjs object being passed that looks like:
replyForm = {
body: someString,
// Gets the file from some input
fileAttachment: event.target.files[0]
}
And I have a function that recieves the replyForm object and tries to pass it into some function like so:
var exe = function (replyForm){
//This is the line that causes my mozilla security exception to go off
sendForm(replyForm);
};
var sendForm = function(replyForm){
// This is when I get the security exception
$('input.fileInput').val(replyForm.fileAttachment);
};
If you want to see how my fileAttachment gets set in Angularjs, please refer bellow:
.directive('ngFile',function(){
return {
scope: {
ngFile: '='
},
link: function(scope, el, attrs){
el.bind('change', function(event){
scope.$apply(function(){
scope.ngFile = event.target.files[0];
});
});
}
};
});
It would be great if anyone could tell me what was wrong with passing an object with a file attached to one of it's properties. Though it seems there is an issue with jQuery trying to do something to the dom which creates some security exception.