Is it normal that the code below is returning "error" when the html-file is not uploaded to my server, and if so: why? It works perfectly once I upload it to my server, though...
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
        function validate() {
                    $.ajax({
                        type:'POST',
                        url:'http://www.mywebsite.com/formvalidate.php',
                        data:{
                        },
                        dataType:'json',
                        success:function (data) {
                            alert('success');
                        },
                        error:function (XMLHttpRequest, textStatus, errorThrown) {
                            alert('error');
                        }
                    });
                }
</script>
</head>
<body>
<input type=button onclick="validate();" value="Click me"/>
</body>
 
     
     
     
    