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

$ is not defined #156

Open
Thebinoman opened this issue Sep 7, 2023 · 1 comment
Open

$ is not defined #156

Thebinoman opened this issue Sep 7, 2023 · 1 comment

Comments

@Thebinoman
Copy link

Thebinoman commented Sep 7, 2023

Here is the most simple HTML implementation:

<html>

<head>
    <script type="text/javascript" src="./jquery.csv.js"></script>
</head>

<body>

</body>
<script>
    console.log($) // Uncaught ReferenceError: $ is not defined
</script>

</html>

When logging $, I get an error that says that $ is not defined.
This is true also with '$.csv' | '$.csv.ToArray' | '$.csv.ToArray("whatever text")' | etc.

Environment

  • Platform: Browser
  • Version: Edge 116.0.1938.69
  • Usage: Load from file with <script> tag
@kokitax
Copy link

kokitax commented Sep 7, 2023

You aren't loading jQuery, this library is just extending $ object.

I just added the jQuery library to your example and it works properly.

<html>

<head>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="./jquery.csv.js"></script>
</head>

<body>

</body>
<script>
    console.log($) // $ is defined
    console.log($.csv) // $.csv is also defined
</script>

</html>

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