codebrew/backbone-rails — Issue #95: datalink causing security error: 1000 in Firefox
Author: versioncontrol
Created: 2012-02-26 14:27:59+00:00
State: open

When loading a template with a file input in Firefox, the browser throws a security error 1000 after a file is selected for the first time.

When a file is selected a second time, the error isn't thrown.

The error is thrown because of line 9:
(return el.val(model.get(name));)

– the cause is reading the value of a fileinput field. The easiest fix right now is to catch the error, since it seems to happen only in firefox and only on the first attempt.

try {
return el.val(model.get(name));
}
catch(e) {}

Not really a fix, but a good workaround.