Posts by marquinho • 489 points
15 posts
-
6
votes3
answers303
viewsQ: When I compare two strings to the "bigger" and "smaller" operators, what am I comparing?
var a = "a"; var b = "b"; if (a < b) // verdadeiro console.log(a + " é menor que " + b); else if (a > b) console.log(a + " é maior que " + b); else console.log(a + " e " + b + " são iguais.");…
-
0
votes1
answer28
viewsQ: How to fix this problem by keeping the "player" inside the "zone"?
I am developing a game in which the user presses the arrow keys (left, up, right, down) and the character moves without leaving the area where he is or is going to see a "collision", but for this I…
javascriptasked marquinho 489 -
0
votes1
answer68
viewsQ: Why isn’t my animation working?
I’m creating an animation that was supposed to work in which it aims to appear and disappear the content of the paragraph, but nothing happens: <!doctype html> <html lang="en">…
-
-2
votes1
answer25
viewsQ: Is there any method to return the URL of the chosen file in a "file" input element?
What I would like is that, for example, by clicking on the entry element of the type file (input type="file") he would return me to URL complete of the file the user has chosen, just this! for later…
javascriptasked marquinho 489 -
6
votes0
answers46
viewsQ: What is a (Node) node in Javascript?
I came across that term knot or Node in Javascript on the website of MDN Web Docs what would that be? NOTE: I am not referring to the application platform Node.js.…
javascriptasked marquinho 489 -
4
votes3
answers101
viewsQ: Why am I not able to modify the class of the element with the classList property?
I’m using the property classList to modify the class of the element, but it does not happen the result I want, because it does not modify the current class to the new. let p1 =…
javascriptasked marquinho 489 -
0
votes0
answers48
viewsQ: What is the difference between using dropEffect and effectAllowed properties?
The MDN Web Docs specifies what the two properties do: effectAllowed The Datatransfer.effectAllowed property specifies the allowed effect for a drag operation. The copy operation is used to indicate…
javascriptasked marquinho 489 -
4
votes1
answer50
viewsQ: Why does the dropEffect property not work?
I’m wanting to switch between cursors copy, move or link when a draggable element is dragged using the property dropEffect or when the event dragstart occur, but it changes nothing visually:…
javascriptasked marquinho 489 -
0
votes1
answer28
viewsQ: Why are you returning this error to me on the console?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">…
javascriptasked marquinho 489 -
2
votes1
answer90
viewsQ: Is there any difference or advantage of using drag and drop events and mouse events?
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">…
javascriptasked marquinho 489 -
3
votes1
answer157
viewsQ: What is the Datatransfer property for?
I am learning drag and drop in Javascript and I’m not really understanding what the property is for DataTransfer, for example her syntax would be something like:…
javascriptasked marquinho 489 -
8
votes1
answer250
viewsQ: In how many milliseconds is the drag event fired?
On the website of W3schools they mention that the event takes place in 350 milliseconds: Note: While dragging an element, the ondrag Event Fires Every 350 milliseconds. Only that it varies this…
javascriptasked marquinho 489 -
0
votes1
answer80
viewsQ: What is the difference between function and method?
Several references mention syntax commands Javascript as addEventListener(), pop(), querySelector() and etc as methods: trainingweb w3schools But the very MDN Web Docs defines these commands as…
javascriptasked marquinho 489 -
3
votes2
answers185
viewsQ: Why pass Event in a function as a parameter?
I have this doubt for a long time, but I’m posting it now. I’ve seen several times in codes the programmers use as a parameter in functions event and I always wonder if it has any relevance in using…
javascriptasked marquinho 489 -
4
votes1
answer37
viewsQ: What is the difference between canplay and canplaythrough?
Both events canplay and canplaythrough are similar, but what is the main difference between using one and the other?
javascriptasked marquinho 489