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

jQuery is not defined #87

Open
PRF-IPA opened this issue Nov 7, 2018 · 1 comment
Open

jQuery is not defined #87

PRF-IPA opened this issue Nov 7, 2018 · 1 comment

Comments

@PRF-IPA
Copy link

PRF-IPA commented Nov 7, 2018

------ Check other post below -----

Uncaught ReferenceError: jQuery is not defined
at jquery.highlight-within-textarea.js:380

Gives me that error, I downloaded it with npm, included the files like this in my HTML

<link rel="stylesheet" href="node_modules\highlight-within-textarea\jquery.highlight-within-textarea.css">
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="node_modules\highlight-within-textarea\jquery.highlight-within-textarea.js"></script>

I can see that the linkage works as no 404 in console.

<textarea id="content-editor"></textarea> <script> $('textarea').highlightTextarea({ words: ['Lorem ipsum', 'vulputate'] }); </script>

Uncaught ReferenceError: $ is not defined (I assume this one is related to the first error)

Any suggestions? Thanks.

@PRF-IPA
Copy link
Author

PRF-IPA commented Nov 7, 2018

----- Note ---- My issue up above was not due to his library, it was due to Electron, so if someone is using this with Electron make sure you add your scripts like this,

<script>window.$ = window.jQuery = require('jquery');</script> <script src="node_modules\highlight-within-textarea\jquery.highlight-within-textarea.js" onload="window.$ = window.jQuery = module.exports;"></script>

anyhow, I am left with this issue,

Uncaught TypeError: $(...).highlightTextarea is not a function

Thanks.

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

1 participant