Help with .ajax

Help with .ajax

Hello,

I sometimes get a 304 Not Modified error and sometimes a 200 ok, using .ajax. Now I can't tell if its my code, or something else. Browsing the internet for an hour has come up with no answers on how to fix this, just how to make an exception for it. I've whittled this down to about as simple as it can get, even using the jQuery API example code.

Html/Javascript
  1. <form>
    <textarea id="mytextarea" rows="3" cols="10">STUFF</textarea>
    <input type="submit" id="abc" />
    </form>
    <script>

        $('#abc').submit(function(){
           
           
            $.ajax({
                type: "POST",
                url: "test.php",
                data: "name=John&location=Boston",
                success: function(msg) {
                    alert(msg);
                }
            });
        });
    </script>


















test.php
  1. <php
  2. if (isset($_POST))
  3. {
  4.       echo "Yes";
  5. }
  6. ?>
I have read that it is caching, and tried "cache: false". Not sure if that is the right thing to do, but I gave it a shot. Any help would be greatly appreciated.

Thank you.