1

Here's (a part of) my html/jquery:

<script type="text/javascript">
        $(document).ready(function(){
                $("form").submit(function(){
                    var_form_data = $(this).serialize();

                    $.ajax({
                        url: "/userHandler.php",
                        data: var_form_data,
                        datatype:"json",
                        type:"POST",
                        success: function(status){
                            console.log("made it");
                        },
                        error: function(jqXHR, textStatus, errorThrown){
                            console.log("failed");
                        }       
                    }); 
                });
        });

And here's the php file in its entirety:

<?php
echo json_encode("got to php file!!!");

?>

The error code always runs and displays what I put in the title, which doesn't help me much. Obviously not a cross-domain error. Anyone know whats wrong?

Thanks.

Ja͢ck
  • 170,779
  • 38
  • 263
  • 309

0 Answers0