Trying to figure out how this is possible...
$(function() {
$('#saveBtn').click(save());
});
function save(){
alert('uh');
}
.
<form id="video-details" method="post" action="">
<input id="saveBtn" class="submit" type="submit" name="submit" value="Submit Video" disabled/>
</form>
I set a breakpoint on the save()
function and it is being called by an anonymous function on the line with the click event listed. However this is happening directly on load, not to mention that the input starts off invisible and disabled so there is no way to click it.
I changed the click function to different elements that both exist and don't exist and whatever I make it the function still fires on pageload
.
Not sure where else to investigate the cause of this, but I'm assuming it's not normal behaviour