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

183
Views
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
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!