Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myModule is not a function at HTMLDocument #62

Open
Giulico opened this issue Jun 8, 2015 · 0 comments
Open

myModule is not a function at HTMLDocument #62

Giulico opened this issue Jun 8, 2015 · 0 comments

Comments

@Giulico
Copy link

Giulico commented Jun 8, 2015

hi everybody,
I'm trying to use the "jqueryPluginCommonjs.js" for the first time and I'm using browserify to create the bundle for the browser.
I wrapped a simple jquery plugin that I made (and tested) before, but I can't figure out why it works only if I specify the "browser" property within the package.json of my app:

"browser": {
  "fvalidation": "./node_modules/fvalidation/index.js"
},
"dependencies": {
  "fvalidation": "^0.1.1"
}

If I don't specify the browser field i get the error:

TypeError: $(...).fvalidation is not a function at HTMLDocument.

The module is here: https://github.com/Giulico/fValidation
And in my app.js file I'm doning something like this

var fvalidation = require('fvalidation');
$(document).ready(function() {
  $('#myForm').fvalidation({
      onSubmit: function() { console.log('done!'); }
    });
});

I’m wondering if you might help me to understand what am I wrong.
Thank you in advance
Giulio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Giulico and others