Skip to content
This repository was archived by the owner on Mar 27, 2026. It is now read-only.
This repository was archived by the owner on Mar 27, 2026. It is now read-only.

Bug with multiple use of fileReader() ? #42

Description

@Epiju

Hi everyone,

I'm using Jahdrien's FileReader (many thanks!) but I think I have a problem with calling fileReader() multiple times in my JS file.

I'm using it in a Rails app, i'm using CoffeeScript for the JS part. I'm trying to preview images with IE9.

I have multiple input and I'm calling multiple times the function fileReader() but when I do so it seems to break stuff... Do someone had the same issue?

previewImage = (event) ->
 * do stuff *

$input = $("#my_input")
$input.fileReader()
$input.change (event) ->
   previewImage(event)

It works fine.

But then I add :

anotherPreviewImage = (event) ->
 * do stuff *

$anotherInput = $("#my_input2")
$anotherInput.fileReader()
$anotherInput.change (event) ->
   anotherPreviewImage(event)

And the whole thing doesn't work anymore on IE9...

Thanks for helping me!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions