I am having this page:
<html>
<head>
</head>
<body>
<div id="uploadBox">
<div id="uploadarea">
<div id="dragandrophandler">Drag and Drop Files Here</div>
<input style='display:none;' type="file" name="file" id="file" />
<span onclick="$('#file').click();">click it</span>
<div id="status1"></div>
</div>
</div>
<script src="JQueryJS.js"></script>
<script>
(function (){
...
//closes and passes the jQuery var into immediate function
}(jQuery))
</script>
</body>
</html>
This page was existing code written by others. And the onclick event is not working. It keeps on throwing exceptions. But if I remove the (JQuery) at the bottom, it works fine then. So I am just wondering does the (JQuery) actually do anything? I am pretty new to jQuery so I am not sure how this works. I am not seeing it referenced by any other piece of code. Is it safe for me to remove it?
----
(function() {
...
//closes and passes the jQuery var into immediate function
}(jQuery))
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="uploadBox">
<div id="uploadarea">
<div id="dragandrophandler">Drag and Drop Files Here</div>
<input style='display:none;' type="file" name="file" id="file" />
<span onclick="$('#file').click();">click it</span>
<div id="status1"></div>
</div>
</div>
onclickand not writing the.click(function(){})in the script? also, have a look at this link, it would help a lot => learn.jquery.com/using-jquery-core/document-ready