次のエラーが表示されます。
[Exception... "The operation is insecure." code: "18" nsresult: "0x80530012 (SecurityError)" location: "http://code.jquery.com/jquery-1.9.1.js Line: 2257"]
コードを調べてみましたが、例外が何であるかがわかりません。簡単に言えば、次のような Angularjs オブジェクトが渡されます。
replyForm = {
body: someString,
// Gets the file from some input
fileAttachment: event.target.files[0]
}
そして、replyFormオブジェクトを受け取り、それを次のような関数に渡そうとする関数があります:
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);
};
私の fileAttachment が Angularjs でどのように設定されるかを確認したい場合は、以下を参照してください。
.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];
});
});
}
};
});
プロパティの1つにファイルが添付されたオブジェクトを渡すことの何が問題だったのか、誰かが教えてくれたら素晴らしいでしょう。jQuery が dom に対して何かを行おうとすると、セキュリティ例外が発生するという問題があるようですが。