0

I am trying to create a simple post request but I can't get the response from the server as far as I can tell there's nothing wrong with it but I might be wrong:

<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        $.post("http://myurl.com/receiver/", { name: "Sean", email: "myemail@domain.com" }, function(data){
            var result = $.parseJSON(data);
            console.log(result);
            alert(result);
        });
    });
</script>

EDIT

opening Chrome dev tools gives me:

XMLHttpRequest cannot load http://myurl.com/receiver/. Origin null is not allowed by Access-Control-Allow-Origin.

I tried uploading to my server or running chrome with --allow-file-access-from-filesbut I get the same message

Tsundoku
  • 8,114
  • 26
  • 88
  • 125

0 Answers0