I am new to Javascript and its syntaxes. Hope you all can help clear my doubts.
Q1)
<script>
$(document).ready(function() {...}
</script>
What does the "$(document...." part mean? I thought a function is started with
function(var){...}
? What the Difference? and when do i use "$" symbol?
Q2)
Js code
$('#dropzone').on('dragover', function(e) {
e.preventDefault();
e.stopPropagation();
e.originalEvent.dataTransfer.dropEffect = 'copy';
});
Html code
<div id="dropzone">
<span>Drop an image file here</span>
<canvas></canvas>
</div>
Based on the above, I see that "#dropzone" is linked to the "div id='dropzone'", correct? and i dont get the part of " function(e)"? what role does puting a function at that spot denotes?
Thank For your replies :)