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

185
Visualizações
Drag and Drop error when dropping on self

I'm using VbsEdit to edit an html file and run it as a exe. I'm using VbsEdit rather than other code editors because, it can convert html to exe and I'm trying to make an application with HTML/JS/CSS without it being in a browser. VbsEdit displays an error window with the drag and drop code I have when I drag a object onto itself. Personally the error won't bother me because I won't be dragging the object onto itself, but it's not mainly for myself.

function allowDrop(ev) {
    ev.preventDefault();
}

function drag(ev) {
    ev.dataTransfer.setData("text", ev.target.id);
}

function drop(ev) {
    ev.preventDefault();
    var data = ev.dataTransfer.getData("text");
    ev.target.appendChild(document.getElementById(data)); //Line that always has error

    /* (idea that failed)
    if(ev.target.a.classList.contains("Item") != true) {
        ev.target.appendChild(document.getElementById(data));
    }
    */
}

Answers for questions that I think might have come up:

  • The error also occurs in browser but which shows it isn't a problem with VbsEdit
  • I'm not using any libraries(and don't plan to (please don't recommend jQuery or anything else)) or any code used only in VbsEdit (Works the exact same in browser).
  • Converting the html file into an exe does not get rid of the error it still displays a error window that interrupts the application.
  • I'm not using browser for other reason that have nothing to do with this.
  • The a in ev.target.a.classList.contains("Item") does contain Item in the classes. (If I missed any question that could have been asked (I know I did because, I forgot half of the questions I came up with before I could type them) feel free to ask but I'm not online often so, sorry if it takes me a while to reply)
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