i'm submitting a form through ajax. it worked perfectly when the server script was hosted on my local computer. Now i've uploaded it unto my remote hosting server and it fails to do the call
when the file was on the local machine the script looked like this
<script language="javascript">
$(document).ready(function(){
$("form").on('submit',function(event){
event.preventDefault();
data = $(this).serialize();
$.ajax({
type: "POST",
url: "login.php",
data: data
}).success(function(msg) {
$('#message').html(msg);
});
});
});
</script>
Remote hosting server
<script language="javascript">
$(document).ready(function(){
$("form").on('submit',function(event){
event.preventDefault();
data = $(this).serialize();
$.ajax({
type: "POST",
url: "http://mysite/login.php",
data: data
}).success(function(msg) {
$('#message').html(msg);
});
});
});
</script>
Now when i click on the submit button nothing happens