Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

213
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda