0

I am trying to extend the basic functionality of this gem. The basic functionality works well. What I am trying to do:

:javascript
  var filepicker = filepicker.setKey('my key');
  function check_mimetype(file_data){
    filepicker.get_file('image/*', function(file_data.url, file_data.mimytype){ #error pointing here
    ...
  });

  }

But I always get this error:

Uncaught SyntaxError: Unexpected token . 

I don't know what can be wrong - Filepicker's key is added, Filepicker's JS library is loaded... This data are in the file _form.html.haml. (jQuery is obviously loaded as well)

Any ideas what's wrong?

Thank you

user984621
  • 46,344
  • 73
  • 224
  • 412

1 Answers1

0

You are defining a function with argument names that have a . in them. That's not allowed. Try:

filepicker.get_file('image/*', function(file_url, file_mimetype) {
...
colllin
  • 9,442
  • 9
  • 49
  • 65