Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
importing module and accessing it properly

I was trying to use the CodeJar editor plugin but the setup is confusing me. I was following the documentation and other examples too but still don't understand it. So my question is, is CodeJar a server-side or a client-side plugin? Why I am asking this is I used a CDN link to import codeJar as a module but the term codeJar is not being recognized in my js file. This probably means codeJar is not being imported to be assigned but I clearly imported it. But on the other hand, there is a line in the code to get the editor element i.e const editor = document.querySelector(".editor");, this can't be used in server-side because we are accessing client-side element. This is probably something obvious I missed. Can someone give me clarity on this? Thanks in advance.

Their documentation: https://github.com/antonmedv/codejar#getting-started

THIS is a working demo seems like it is running on the client side??? : https://codepen.io/antonmedv/pen/PoPoGwg

const highlight = (editor) => {
  const code = editor.textContent
  editor.innerHTML = code
}

const editor = document.querySelector(".editor");
const jar = new CodeJar(editor, highlight);
<script defer type="module">
  import { CodeJar } from 'https://medv.io/codejar/codejar.js'
</script>

<div class="editor"></div>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!