I have a stupid simple Jquery .js file I'm busy creating and I'm getting stuck on the first step.
I currently have it setup as shown below and yet every time I click the only button on the page (submit button for a login page), it reloads the entire page and runs the first function again.
How do i get the function to only run once
$(document).ready(function() {
//
// FUNCTIONS
//
function AllFade() {
//Hide everything
$('div').hide()
//Fade Everything in
$('div').fadeIn(1000);
//Hide All Alerts
$('.alert').hide();
}
function LoginCheck() {
//Check username and pass
}
// EVENTS
//START SEQUENCE
AllFade();
//Login check on submit
$('.btn').click(function() {
LoginCheck();
})
});
!! EDIT !!
The button's coding is this exactly:
<button class="btn btn-large btn-primary">Sign in</button>
Would that still cause a reload?