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

$.SpellCheck is not a constructor #80

Open
ninohhh opened this issue Aug 31, 2018 · 1 comment
Open

$.SpellCheck is not a constructor #80

ninohhh opened this issue Aug 31, 2018 · 1 comment

Comments

@ninohhh
Copy link

ninohhh commented Aug 31, 2018

I followed the documentation and included the usage into the webpage. When I clicked on the button, it was showing an error of "$.SpellCheck is not a constructor"

@petercontrains
Copy link

try

<script src="{{ asset('js/lib/jquery/jquery-1.8.2.min.js')}}"></script>
<script src="{{ asset('js/lib/bootstrap/bootstrap.min.js')}}"></script>
<script src="{{ asset('js/lib/prettyprint/prettyprint.js')}}"></script>
<script src="{{ asset('js/jquery.spellchecker.js')}}"></script>
<script src="{{ asset('js/app.js')}}"></script>

var spellchecker = new $.SpellChecker('#html-content', {
lang: 'es',
parser: 'html',
webservice: {
path: '{{route('webservices_spellchecker')}}',
driver: 'PSpell'
},
suggestBox: {
position: 'below',
offset: 1
}
});

  // Bind spellchecker handler functions
  spellchecker.on('check.success', function() {
    //alert('No hay palabras mal deletreadas!');
  });

  // Check the spelling when user clicks on button
  $("#check-spelling-html").click(function(e){
    spellchecker.check();
  });
    spellchecker.check();
})();
</script>

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